From 92540ad15e5402e8442de52e577474aba315c9a3 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 3 May 2011 14:57:29 -0400 Subject: Non-printable character. --- editeng/source/editeng/editeng.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 7b65b92c6e55..efc8dc4c8c38 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -113,7 +113,7 @@ SV_IMPL_VARARR( EECharAttribArray, EECharAttrib ); static SfxItemPool* pGlobalPool=0; - // ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- // EditEngine // ---------------------------------------------------------------------- EditEngine::EditEngine( SfxItemPool* pItemPool ) -- cgit v1.2.3 From ec290dfbf2fc8ff41751f3d7b961500ba62a01a3 Mon Sep 17 00:00:00 2001 From: Marcel HB Date: Tue, 3 May 2011 20:02:40 +0100 Subject: fix for fdo#33462 resets the row properties after each row is processed. --- writerfilter/inc/resourcemodel/TableManager.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/writerfilter/inc/resourcemodel/TableManager.hxx b/writerfilter/inc/resourcemodel/TableManager.hxx index 5d5d819b8581..ad43cd998de5 100644 --- a/writerfilter/inc/resourcemodel/TableManager.hxx +++ b/writerfilter/inc/resourcemodel/TableManager.hxx @@ -221,7 +221,7 @@ class TableManager void resetRowProps() { - mpCellProps.reset(); + mpRowProps.reset(); } void setRowProps(PropertiesPointer pProps) -- cgit v1.2.3 From 00c5556869d8f382551675128d3db7bed397a77f Mon Sep 17 00:00:00 2001 From: Noel Power Date: Tue, 3 May 2011 15:20:50 +0100 Subject: svx-hacky-htmlselect-control-import.diff ( bnc#523191 ) --- filter/inc/filter/msfilter/msocximex.hxx | 25 ++++++ filter/source/msfilter/msocximex.cxx | 139 +++++++++++++++++++++++++++++++ 2 files changed, 164 insertions(+) diff --git a/filter/inc/filter/msfilter/msocximex.hxx b/filter/inc/filter/msfilter/msocximex.hxx index b639730785ec..5e1915d0406f 100644 --- a/filter/inc/filter/msfilter/msocximex.hxx +++ b/filter/inc/filter/msfilter/msocximex.hxx @@ -1177,6 +1177,31 @@ public: const com::sun::star::awt::Size& rSize ); }; +class HTML_Select : public OCX_ModernControl +{ +public: + HTML_Select() : OCX_ModernControl(rtl::OUString::createFromAscii("TextBox")) { + msFormType = rtl::OUString::createFromAscii("com.sun.star.form.component.ListBox"); + msDialogType = rtl::OUString::createFromAscii("com.sun.star.form.component.ListBox"); + mnBackColor = 0x80000005L; + mnForeColor = 0x80000008L; + nBorderColor = 0x80000006L; + aFontData.SetHasAlign(sal_True); + fEnabled = true; + nMultiState =false; + } + + using OCX_ModernControl::Import; // to not hide the other two import methods + virtual sal_Bool Import(com::sun::star::uno::Reference< + com::sun::star::beans::XPropertySet> &rPropSet); + + static OCX_Control *Create() { return new HTML_Select;} + + virtual sal_Bool Read(SotStorageStream *pS); + virtual sal_Bool ReadFontData(SotStorageStream *pS); + com::sun::star::uno::Sequence< rtl::OUString > msListData; + com::sun::star::uno::Sequence< sal_Int16 > msIndices; +}; class HTML_TextBox : public OCX_ModernControl { diff --git a/filter/source/msfilter/msocximex.cxx b/filter/source/msfilter/msocximex.cxx index 3d87c8f8fa0a..835070c58116 100644 --- a/filter/source/msfilter/msocximex.cxx +++ b/filter/source/msfilter/msocximex.cxx @@ -4270,6 +4270,8 @@ OCX_map aOCXTab[] = {&OCX_ProgressBar::Create,"", form::FormComponentType::CONTROL,""}, {&HTML_TextBox::Create,"5512D124-5CC6-11CF-8d67-00aa00bdce1d", form::FormComponentType::TEXTFIELD,"TextBox"}, + {&HTML_Select::Create,"5512D122-5CC6-11CF-8d67-00aa00bdce1d", + form::FormComponentType::LISTBOX,"ListBox"}, }; const int NO_OCX = sizeof( aOCXTab ) / sizeof( *aOCXTab ); @@ -5054,6 +5056,143 @@ sal_Bool HTML_TextBox::ReadFontData(SotStorageStream * /*pS*/) return sal_True; } +// HTML_Select +sal_Bool HTML_Select::Import(com::sun::star::uno::Reference< + com::sun::star::beans::XPropertySet> &rPropSet) +{ + uno::Any aTmp(&sName,getCppuType((OUString *)0)); + rPropSet->setPropertyValue( WW8_ASCII2STR("Name"), aTmp ); + + sal_Bool bTmp=fEnabled; + aTmp = bool2any(bTmp); + rPropSet->setPropertyValue( WW8_ASCII2STR("Enabled"), aTmp); + + bTmp=fLocked; + aTmp = bool2any(bTmp); + rPropSet->setPropertyValue( WW8_ASCII2STR("ReadOnly"), aTmp); + + aTmp <<= ImportColor(mnForeColor); + rPropSet->setPropertyValue( WW8_ASCII2STR("TextColor"), aTmp); + + sal_Bool bTemp = nMultiState; + aTmp = bool2any(bTemp); + rPropSet->setPropertyValue( WW8_ASCII2STR("MultiSelection"), aTmp); + + aTmp <<= ImportColor(mnBackColor); + rPropSet->setPropertyValue( WW8_ASCII2STR("BackgroundColor"), aTmp); + + aTmp <<= ImportBorder(nSpecialEffect,nBorderStyle); + rPropSet->setPropertyValue( WW8_ASCII2STR("Border"), aTmp); + + aTmp <<= ImportColor( nBorderColor ); + rPropSet->setPropertyValue( WW8_ASCII2STR("BorderColor"), aTmp); + + if ( msListData.getLength() ) + { + aTmp <<= msListData; + rPropSet->setPropertyValue( WW8_ASCII2STR("StringItemList"), aTmp); + if ( msIndices.getLength() ) + { + aTmp <<= msIndices; + rPropSet->setPropertyValue( WW8_ASCII2STR("SelectedItems"), aTmp); + } + } + rPropSet->setPropertyValue( WW8_ASCII2STR("Dropdown"), uno::makeAny( sal_True )); + + return sal_True; +} + +sal_Bool HTML_Select::Read(SotStorageStream *pS) +{ + static rtl::OUString sTerm( RTL_CONSTASCII_USTRINGPARAM("> ch; + sal_Unicode uni = static_cast< sal_Unicode >( ch ); + // if the buffer ends with we are done + if ( uni == '>' ) + { + rtl::OUString bufContents( buf.getStr() ); + if ( bufContents.indexOf( sTerm ) != -1 ) + bTerminate = true; + + } + buf.append( &uni, 1 ); + + } while ( !pS->IsEof() && !bTerminate ); + String data = buf.makeStringAndClear(); + + // replace crlf with lf + data.SearchAndReplaceAll( String( RTL_CONSTASCII_USTRINGPARAM( "\x0D\x0A" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "\x0A" ) ) ); + std::vector< rtl::OUString > listValues; + std::vector< sal_Int16 > selectedIndices; + + // Ultra hacky parser for the info + sal_Int32 nTokenCount = data.GetTokenCount( '\n' ); + + for ( sal_Int32 nToken = 0; nToken < nTokenCount; ++nToken ) + { + String sLine( data.GetToken( nToken, '\n' ) ); + if ( !nToken ) // first line will tell us if multiselect is enabled + { + if ( sLine.CompareTo( sMultiple, sMultiple.Len() ) == COMPARE_EQUAL ) + nMultiState = true; + } + // skip first and last lines, no data there + else if ( nToken < nTokenCount - 1) + { + if ( sLine.GetTokenCount( '>' ) ) + { + String displayValue = sLine.GetToken( 1, '>' ); + if ( displayValue.Len() ) + { + // Really we should be using a proper html parser + // escaping some common bits to be escaped + displayValue.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "<" ) ), String( RTL_CONSTASCII_USTRINGPARAM("<") ) ); + displayValue.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( ">" ) ), String( RTL_CONSTASCII_USTRINGPARAM(">") ) ); + displayValue.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( """ ) ), String( RTL_CONSTASCII_USTRINGPARAM("\"") ) ); + displayValue.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "&" ) ), String( RTL_CONSTASCII_USTRINGPARAM("&") ) ); + listValues.push_back( displayValue ); + if( sLine.Search( sSelected ) != STRING_NOTFOUND ) + selectedIndices.push_back( static_cast< sal_Int16 >( listValues.size() ) - 1 ); + } + } + } + } + if ( listValues.size() ) + { + msListData.realloc( listValues.size() ); + sal_Int32 index = 0; + for( std::vector< rtl::OUString >::iterator it = listValues.begin(); it != listValues.end(); ++it, ++index ) + msListData[ index ] = *it; + } + if ( selectedIndices.size() ) + { + msIndices.realloc( selectedIndices.size() ); + sal_Int32 index = 0; + for( std::vector< sal_Int16 >::iterator it = selectedIndices.begin(); it != selectedIndices.end(); ++it, ++index ) + msIndices[ index ] = *it; + } + return sal_True; +} + +sal_Bool HTML_Select::ReadFontData(SotStorageStream* /*pS*/) +{ + return sal_True; +} + // Doesn't really read anything but just skips the // record. sal_Bool OCX_TabStrip::Read(SotStorageStream *pS) -- cgit v1.2.3 From 06d961bea1c17d2cb4e12b3270b2d6aa9f89cae4 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 3 May 2011 16:05:44 -0400 Subject: fdo#36746: Prevent crash during sort. This was indirectly caused by the change in SfxUndoManager, to keep track of lock count to allow nested enabling / disabling of undo operations. Because of this, it's very important to not enable / disable unless it's currently disabled / enabled, respectively. --- sc/source/core/data/document.cxx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 8d236383dac2..c5f8b1c1c71c 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -5422,7 +5422,22 @@ void ScDocument::SetSubTotalCellsDirty(const ScRange& rDirtyRange) void ScDocument::EnableUndo( bool bVal ) { - GetUndoManager()->EnableUndo(bVal); + // The undo manager increases lock count every time undo is disabled. + // Because of this, we shouldn't disable undo unless it's currently + // enabled, or else re-enabling it may not actually re-enable undo unless + // the lock count becomes zero. + + if (bVal) + { + if (!GetUndoManager()->IsUndoEnabled()) + GetUndoManager()->EnableUndo(true); + } + else + { + if (GetUndoManager()->IsUndoEnabled()) + GetUndoManager()->EnableUndo(false); + } + mbUndoEnabled = bVal; } -- cgit v1.2.3 From 43936947967a93ec4a8a8ce4f50962bf49a970a1 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 3 May 2011 16:25:39 -0400 Subject: Invalidate page breaks on print range changes. --- sc/source/core/data/table1.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index d4c194676471..554a22773dd6 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -1696,6 +1696,8 @@ void ScTable::SetRepeatColRange( const ScRange* pNew ) if (IsStreamValid()) SetStreamValid(false); + + InvalidatePageBreaks(); } void ScTable::SetRepeatRowRange( const ScRange* pNew ) @@ -1704,6 +1706,8 @@ void ScTable::SetRepeatRowRange( const ScRange* pNew ) if (IsStreamValid()) SetStreamValid(false); + + InvalidatePageBreaks(); } void ScTable::ClearPrintRanges() @@ -1713,6 +1717,8 @@ void ScTable::ClearPrintRanges() if (IsStreamValid()) SetStreamValid(false); + + InvalidatePageBreaks(); } void ScTable::AddPrintRange( const ScRange& rNew ) @@ -1723,6 +1729,8 @@ void ScTable::AddPrintRange( const ScRange& rNew ) if (IsStreamValid()) SetStreamValid(false); + + InvalidatePageBreaks(); } -- cgit v1.2.3 From dc40dabec04300ab3a4578e80a0b2170e62df674 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 3 May 2011 17:16:41 -0400 Subject: fdo#36721: Fixed a crash on datapilot while editing the source range. --- sc/source/ui/dbgui/pvlaydlg.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx index f280af43f7e0..fa063bcf7ab8 100644 --- a/sc/source/ui/dbgui/pvlaydlg.cxx +++ b/sc/source/ui/dbgui/pvlaydlg.cxx @@ -1450,11 +1450,24 @@ void ScDPLayoutDlg::UpdateSrcRange() switch (eSrcType) { case SRC_REF: + { // data source is a range reference. if (inSheet.GetSourceRange() == aNewRange) // new range is identical to the current range. Nothing to do. return; inSheet.SetSourceRange(aNewRange); + sal_uLong nError = inSheet.CheckSourceRange(); + if (nError) + { + // The error number corresponds with string ID for the error + // message. In the future we should display the error message + // somewhere in the dialog to let the user know of the reason + // for error. + aEdInPos.SetRefValid(false); + aBtnOk.Disable(); + return; + } + } break; case SRC_NAME: // data source is a range name. -- cgit v1.2.3 From 184b7e7b959a1769d84f9a1581c71dd315eb184d Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 3 May 2011 17:22:28 -0400 Subject: Simplify the code a bit. --- sc/source/core/data/document.cxx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index c5f8b1c1c71c..b8f026503dc4 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -5427,16 +5427,8 @@ void ScDocument::EnableUndo( bool bVal ) // enabled, or else re-enabling it may not actually re-enable undo unless // the lock count becomes zero. - if (bVal) - { - if (!GetUndoManager()->IsUndoEnabled()) - GetUndoManager()->EnableUndo(true); - } - else - { - if (GetUndoManager()->IsUndoEnabled()) - GetUndoManager()->EnableUndo(false); - } + if (bVal != GetUndoManager()->IsUndoEnabled()) + GetUndoManager()->EnableUndo(bVal); mbUndoEnabled = bVal; } -- cgit v1.2.3 From 9ba100be28096667e32c81ddb17261b1074c1288 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 3 May 2011 22:20:42 -0400 Subject: fdo#36051: Eliminated the hang due to removal of autofill undo object. An artifact of the old code, which appears to do nothing meaningful today was performing an incredibly slow operation upon destruction of the autofill undo object. Removed it, and also removed several other methods and data members that were used only in that removed code. --- sc/inc/document.hxx | 1 - sc/inc/rangenam.hxx | 3 --- sc/inc/table.hxx | 1 - sc/source/core/data/documen2.cxx | 47 ------------------------------------ sc/source/core/data/table4.cxx | 6 ----- sc/source/core/tool/rangenam.cxx | 17 +++---------- sc/source/ui/docshell/docfunc.cxx | 9 +++---- sc/source/ui/inc/undoblk.hxx | 4 +--- sc/source/ui/undo/undoblk3.cxx | 50 ++------------------------------------- 9 files changed, 9 insertions(+), 129 deletions(-) diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 19496d0f3f15..3c485fd48575 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1487,7 +1487,6 @@ public: VirtualDevice* GetVirtualDevice_100th_mm(); SC_DLLPUBLIC OutputDevice* GetRefDevice(); // WYSIWYG: Printer, otherwise VirtualDevice... - void EraseNonUsedSharedNames(sal_uInt16 nLevel); sal_Bool GetNextSpellingCell(SCCOL& nCol, SCROW& nRow, SCTAB nTab, sal_Bool bInSel, const ScMarkData& rMark) const; diff --git a/sc/inc/rangenam.hxx b/sc/inc/rangenam.hxx index c9e00e64dfb1..3689634ba62d 100644 --- a/sc/inc/rangenam.hxx +++ b/sc/inc/rangenam.hxx @@ -181,7 +181,6 @@ class ScRangeName private: typedef ::boost::ptr_set DataType; DataType maData; - sal_uInt16 mnSharedMaxIndex; public: /// Map that manages stored ScRangeName instances. @@ -208,8 +207,6 @@ public: void UpdateTabRef(SCTAB nTable, sal_uInt16 nFlag, SCTAB nNewTable = 0); void UpdateTranspose(const ScRange& rSource, const ScAddress& rDest); void UpdateGrow(const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY); - sal_uInt16 GetSharedMaxIndex(); - void SetSharedMaxIndex(sal_uInt16 nInd); SC_DLLPUBLIC const_iterator begin() const; SC_DLLPUBLIC const_iterator end() const; diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 26cb8a846263..cf30f6b23cd8 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -173,7 +173,6 @@ private: ScSortParam aSortParam; CollatorWrapper* pSortCollator; sal_Bool bGlobalKeepQuery; - sal_Bool bSharedNameInserted; ScRangeVec aPrintRanges; bool bPrintEntireSheet; diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index 2188a458a855..756990e681bc 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -1130,53 +1130,6 @@ void ScDocument::SetError( SCCOL nCol, SCROW nRow, SCTAB nTab, const sal_uInt16 pTab[nTab]->SetError( nCol, nRow, nError ); } -namespace { - -bool eraseUnusedSharedName(ScRangeName* pRangeName, ScTable* pTab[], sal_uInt16 nLevel) -{ - if (!pRangeName) - return false; - - ScRangeName::iterator itr = pRangeName->begin(), itrEnd = pRangeName->end(); - for (; itr != itrEnd; ++itr) - { - if (!itr->HasType(RT_SHARED)) - continue; - - String aName; - itr->GetName(aName); - aName.Erase(0, 6); // !!! vgl. Table4, FillFormula !! - sal_uInt16 nInd = static_cast(aName.ToInt32()); - if (nInd > nLevel) - continue; - - sal_uInt16 nIndex = itr->GetIndex(); - - bool bInUse = false; - for (SCTAB j = 0; !bInUse && (j <= MAXTAB); ++j) - { - if (pTab[j]) - bInUse = pTab[j]->IsRangeNameInUse(0, 0, MAXCOL-1, MAXROW-1, nIndex); - } - if (!bInUse) - { - pRangeName->erase(itr); - return true; - } - } - return false; -} - -} - -void ScDocument::EraseNonUsedSharedNames(sal_uInt16 nLevel) -{ - if (!pRangeName) - return; - while (eraseUnusedSharedName(pRangeName, pTab, nLevel)) - ; -} - // ---------------------------------------------------------------------------- void ScDocument::SetConsolidateDlgData( const ScConsolidateParam* pData ) diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 55b4da849665..edba012fadd1 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -1576,17 +1576,11 @@ void ScTable::Fill( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScProgress aProgress( pDocument->GetDocumentShell(), ScGlobal::GetRscString(STR_FILL_SERIES_PROGRESS), nProgCount ); - bSharedNameInserted = false; - if (eFillCmd == FILL_AUTO) FillAuto(nCol1, nRow1, nCol2, nRow2, nFillCount, eFillDir, aProgress); else FillSeries(nCol1, nRow1, nCol2, nRow2, nFillCount, eFillDir, eFillCmd, eFillDateCmd, nStepValue, nMaxValue, 0, sal_True, aProgress); - - if (bSharedNameInserted) // Wurde Shared-Name eingefuegt? - pDocument->GetRangeName()->SetSharedMaxIndex( - pDocument->GetRangeName()->GetSharedMaxIndex()+1); // dann hochzaehlen } diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx index 440a9598e59e..df5f43617ae1 100644 --- a/sc/source/core/tool/rangenam.cxx +++ b/sc/source/core/tool/rangenam.cxx @@ -729,11 +729,10 @@ void ScRangeName::copyLocalNames(const TabNameMap& rNames, TabNameCopyMap& rCopy } } -ScRangeName::ScRangeName() : - mnSharedMaxIndex(0) {} +ScRangeName::ScRangeName() {} ScRangeName::ScRangeName(const ScRangeName& r) : - maData(r.maData), mnSharedMaxIndex(r.mnSharedMaxIndex) {} + maData(r.maData) {} const ScRangeData* ScRangeName::findByRange(const ScRange& rRange) const { @@ -806,16 +805,6 @@ void ScRangeName::UpdateGrow(const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY) itr->UpdateGrow(rArea, nGrowX, nGrowY); } -sal_uInt16 ScRangeName::GetSharedMaxIndex() -{ - return mnSharedMaxIndex; -} - -void ScRangeName::SetSharedMaxIndex(sal_uInt16 nInd) -{ - mnSharedMaxIndex = nInd; -} - ScRangeName::const_iterator ScRangeName::begin() const { return maData.begin(); @@ -886,7 +875,7 @@ void ScRangeName::clear() bool ScRangeName::operator== (const ScRangeName& r) const { - return maData == r.maData && mnSharedMaxIndex == r.mnSharedMaxIndex; + return maData == r.maData; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index c9d600f34d9c..62ced922b01f 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -4023,8 +4023,7 @@ sal_Bool ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMar { rDocShell.GetUndoManager()->AddUndoAction( new ScUndoAutoFill( &rDocShell, aDestArea, aSourceArea, pUndoDoc, aMark, - eDir, FILL_SIMPLE, FILL_DAY, MAXDOUBLE, 1.0, 1e307, - pDoc->GetRangeName()->GetSharedMaxIndex()+1 ) ); + eDir, FILL_SIMPLE, FILL_DAY, MAXDOUBLE, 1.0, 1e307) ); } rDocShell.PostPaintGridAll(); @@ -4143,8 +4142,7 @@ sal_Bool ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMar { rDocShell.GetUndoManager()->AddUndoAction( new ScUndoAutoFill( &rDocShell, aDestArea, aSourceArea, pUndoDoc, aMark, - eDir, eCmd, eDateCmd, fStart, fStep, fMax, - pDoc->GetRangeName()->GetSharedMaxIndex()+1 ) ); + eDir, eCmd, eDateCmd, fStart, fStep, fMax) ); } bSuccess = sal_True; @@ -4271,8 +4269,7 @@ sal_Bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillD { rDocShell.GetUndoManager()->AddUndoAction( new ScUndoAutoFill( &rDocShell, aDestArea, aSourceArea, pUndoDoc, aMark, - eDir, eCmd, eDateCmd, MAXDOUBLE, fStep, fMax, - pDoc->GetRangeName()->GetSharedMaxIndex()+1 ) ); + eDir, eCmd, eDateCmd, MAXDOUBLE, fStep, fMax) ); } rDocShell.PostPaintGridAll(); diff --git a/sc/source/ui/inc/undoblk.hxx b/sc/source/ui/inc/undoblk.hxx index d8617490219a..16fc7591ac08 100644 --- a/sc/source/ui/inc/undoblk.hxx +++ b/sc/source/ui/inc/undoblk.hxx @@ -421,8 +421,7 @@ public: ScDocument* pNewUndoDoc, const ScMarkData& rMark, FillDir eNewFillDir, FillCmd eNewFillCmd, FillDateCmd eNewFillDateCmd, - double fNewStartValue, double fNewStepValue, double fNewMaxValue, - sal_uInt16 nMaxShIndex ); + double fNewStartValue, double fNewStepValue, double fNewMaxValue ); virtual ~ScUndoAutoFill(); virtual void Undo(); @@ -444,7 +443,6 @@ private: double fMaxValue; sal_uLong nStartChangeAction; sal_uLong nEndChangeAction; - sal_uInt16 nMaxSharedIndex; void SetChangeTrack(); }; diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index 446e3dede1c6..45ea822f2090 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -602,8 +602,7 @@ ScUndoAutoFill::ScUndoAutoFill( ScDocShell* pNewDocShell, const ScRange& rRange, const ScRange& rSourceArea, ScDocument* pNewUndoDoc, const ScMarkData& rMark, FillDir eNewFillDir, FillCmd eNewFillCmd, FillDateCmd eNewFillDateCmd, - double fNewStartValue, double fNewStepValue, double fNewMaxValue, - sal_uInt16 nMaxShIndex ) + double fNewStartValue, double fNewStepValue, double fNewMaxValue ) // : ScBlockUndo( pNewDocShell, rRange, SC_UNDO_AUTOHEIGHT ), // @@ -615,8 +614,7 @@ ScUndoAutoFill::ScUndoAutoFill( ScDocShell* pNewDocShell, eFillDateCmd ( eNewFillDateCmd ), fStartValue ( fNewStartValue ), fStepValue ( fNewStepValue ), - fMaxValue ( fNewMaxValue ), - nMaxSharedIndex ( nMaxShIndex) + fMaxValue ( fNewMaxValue ) { SetChangeTrack(); } @@ -626,7 +624,6 @@ ScUndoAutoFill::ScUndoAutoFill( ScDocShell* pNewDocShell, ScUndoAutoFill::~ScUndoAutoFill() { - pDocShell->GetDocument()->EraseNonUsedSharedNames(nMaxSharedIndex); delete pUndoDoc; } @@ -649,26 +646,6 @@ void ScUndoAutoFill::SetChangeTrack() nStartChangeAction = nEndChangeAction = 0; } -namespace { - -bool eraseNameContaining(ScRangeName& rNames, const rtl::OUString& rCriteria) -{ - ScRangeName::iterator itr = rNames.begin(), itrEnd = rNames.end(); - for (; itr != itrEnd; ++itr) - { - rtl::OUString aRName = itr->GetName(); - if (aRName.indexOf(rCriteria) >= 0) - { - // Criteria found. Erase this. - rNames.erase(itr); - return true; - } - } - return false; -} - -} - void ScUndoAutoFill::Undo() { BeginUndo(); @@ -698,29 +675,6 @@ void ScUndoAutoFill::Undo() if (pViewShell) pViewShell->CellContentChanged(); -// Shared-Names loeschen -// Falls Undo ins Dokument gespeichert -// => automatisches Loeschen am Ende -// umarbeiten!! - - String aName = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("___SC_")); - aName += String::CreateFromInt32(nMaxSharedIndex); - aName += '_'; - ScRangeName* pRangeName = pDoc->GetRangeName(); - bool bHasFound = false; - // Remove all range names that contain ___SC_... - while (true) - { - bool bErased = eraseNameContaining(*pRangeName, aName); - if (bErased) - bHasFound = true; - else - break; - } - - if (bHasFound) - pRangeName->SetSharedMaxIndex(pRangeName->GetSharedMaxIndex()-1); - ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack(); if ( pChangeTrack ) pChangeTrack->Undo( nStartChangeAction, nEndChangeAction ); -- cgit v1.2.3 From 0410b1b0306f2232cc799008af963315890bacaf Mon Sep 17 00:00:00 2001 From: Kalman Szalai - KAMI Date: Sat, 23 Apr 2011 09:31:45 +0200 Subject: Add download support to a few extension in bootstrap --- configure.in | 34 +++++++++++++++++++++++++++------- ooo.lst.in | 9 +++++++++ 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index 895d43be5451..939d567c7a22 100755 --- a/configure.in +++ b/configure.in @@ -7150,11 +7150,13 @@ dnl =================================================================== AC_MSG_CHECKING([for Watch Window extension integration]) if test "z$enable_ext_watch_window" = "z" -o "z$enable_ext_watch_window" = "zno" ; then AC_MSG_RESULT([no]) + WATCH_WINDOW_EXTENSION_PACK="" else AC_MSG_RESULT([yes]) SCPDEFS="$SCPDEFS -DWITH_EXTENSION_WATCH_WINDOW" + WATCH_WINDOW_EXTENSION_PACK="23bd75552206dfcd8fd4e29137dcac84-WatchWindow_1.2.0.0.oxt" fi -AC_SUBST(WITH_WATCH_WINDOW_EXTENSION) +AC_SUBST(WATCH_WINDOW_EXTENSION_PACK) dnl =================================================================== dnl Test whether to include Diagram extension @@ -7162,11 +7164,13 @@ dnl =================================================================== AC_MSG_CHECKING([for Diagram extension integration]) if test "z$enable_ext_diagram" = "z" -o "z$enable_ext_diagram" = "zno" ; then AC_MSG_RESULT([no]) + DIAGRAM_EXTENSION_PACK="" else AC_MSG_RESULT([yes]) SCPDEFS="$SCPDEFS -DWITH_EXTENSION_DIAGRAM" + DIAGRAM_EXTENSION_PACK="41c9b65ad60af4b3255bbecdfef11736-Diagram_1.1.0.0.oxt" fi -AC_SUBST(WITH_DIAGRAM_EXTENSION) +AC_SUBST(DIAGRAM_EXTENSION_PACK) dnl =================================================================== dnl Test whether to include Validator extension @@ -7174,11 +7178,13 @@ dnl =================================================================== AC_MSG_CHECKING([for Validator extension integration]) if test "z$enable_ext_validator" = "z" -o "z$enable_ext_validator" = "zno" ; then AC_MSG_RESULT([no]) + VALIDATOR_EXTENSION_PACK="" else AC_MSG_RESULT([yes]) SCPDEFS="$SCPDEFS -DWITH_EXTENSION_VALIDATOR" + VALIDATOR_EXTENSION_PACK="bbdd5639ada63e3130761daaecae1a10-Validator_1.1.0.0.oxt" fi -AC_SUBST(WITH_VALIDATOR_EXTENSION) +AC_SUBST(VALIDATOR_EXTENSION_PACK) dnl =================================================================== dnl Test whether to include Barcode extension @@ -7186,11 +7192,13 @@ dnl =================================================================== AC_MSG_CHECKING([for Barcode extension integration]) if test "z$enable_ext_barcode" = "z" -o "z$enable_ext_barcode" = "zno" ; then AC_MSG_RESULT([no]) + BARCODE_EXTENSION_PACK="" else AC_MSG_RESULT([yes]) SCPDEFS="$SCPDEFS -DWITH_EXTENSION_BARCODE" + BARCODE_EXTENSION_PACK="7e7efc5d4a03126bb9ae3ae9aa2c4e87-Barcode_1.3.1.0.oxt" fi -AC_SUBST(WITH_BARCODE_EXTENSION) +AC_SUBST(BARCODE_EXTENSION_PACK) dnl =================================================================== dnl Test whether to include ConvertTextToNumber extension @@ -7198,11 +7206,14 @@ dnl =================================================================== AC_MSG_CHECKING([for ConvertTextToNumber extension integration]) if test "z$enable_ext_ct2n" = "z" -o "z$enable_ext_ct2n" = "zno" ; then AC_MSG_RESULT([no]) + CT2N_EXTENSION_PACK="" else AC_MSG_RESULT([yes]) BUILD_TYPE="$BUILD_TYPE CT2N" SCPDEFS="$SCPDEFS -DWITH_EXTENSION_CT2N" + CT2N_EXTENSION_PACK="451ccf439a36a568653b024534669971-ConvertTextToNumber-1.3.2.oxt" fi +AC_SUBST(CT2N_EXTENSION_PACK) dnl =================================================================== dnl Test whether to include Numbertext extension @@ -7210,11 +7221,13 @@ dnl =================================================================== AC_MSG_CHECKING([for Numbertext extension integration]) if test "z$enable_ext_numbertext" = "z" -o "z$enable_ext_numbertext" = "zno" ; then AC_MSG_RESULT([no]) + NUMBERTEXT_EXTENSION_PACK="" else AC_MSG_RESULT([yes]) SCPDEFS="$SCPDEFS -DWITH_EXTENSION_NUMBERTEXT" + NUMBERTEXT_EXTENSION_PACK="b8cbca7b3363e6ca2d02bc0ba2b63904-numbertext-0.9.4.oxt" fi -AC_SUBST(WITH_NUMBERTEXT_EXTENSION) +AC_SUBST(NUMBERTEXT_EXTENSION_PACK) dnl =================================================================== dnl Test whether to include Hungarian Cross-reference Toolbar extension @@ -7222,11 +7235,13 @@ dnl =================================================================== AC_MSG_CHECKING([for Hungarian Cross-reference Toolbar extension integration]) if test "z$enable_ext_hunart" = "z" -o "z$enable_ext_hunart" = "zno" ; then AC_MSG_RESULT([no]) + HUNART_EXTENSION_PACK="" else AC_MSG_RESULT([yes]) SCPDEFS="$SCPDEFS -DWITH_EXTENSION_HUNART" + HUNART_EXTENSION_PACK="b632bdd25649cc4067bcb410bae23d2b-hunart-0.3.oxt" fi -AC_SUBST(WITH_HUNART_EXTENSION) +AC_SUBST(HUNART_EXTENSION_PACK) dnl =================================================================== dnl Test whether to include Typography Toolbar extension @@ -7234,11 +7249,13 @@ dnl =================================================================== AC_MSG_CHECKING([for Typography Toolbar extension integration]) if test "z$enable_ext_typo" = "z" -o "z$enable_ext_typo" = "zno" ; then AC_MSG_RESULT([no]) + TYPO_EXTENSION_PACK="" else AC_MSG_RESULT([yes]) SCPDEFS="$SCPDEFS -DWITH_EXTENSION_TYPO" + TYPO_EXTENSION_PACK="9d60b6cfa3ef1926848710bbcd11115b-typo-0.4.2.oxt" fi -AC_SUBST(WITH_TYPO_EXTENSION) +AC_SUBST(TYPO_EXTENSION_PACK) dnl =================================================================== dnl Test whether to include Google Docs extension @@ -7246,10 +7263,13 @@ dnl =================================================================== AC_MSG_CHECKING([for Google Docs extension integration]) if test "z$enable_ext_google_docs" = "z" -o "z$enable_ext_google_docs" = "zno" ; then AC_MSG_RESULT([no]) + GOOGLE_DOCS_EXTENSION_PACK="" else AC_MSG_RESULT([yes]) SCPDEFS="$SCPDEFS -DWITH_EXTENSION_GOOGLE_DOCS" + GOOGLE_DOCS_EXTENSION_PACK="dbaafd21de055e582d92d7d32fe9da13-gdocs_2.3.1.oxt" fi +AC_SUBST(GOOGLE_DOCS_EXTENSION_PACK) dnl =================================================================== dnl Test whether to include NLPSolver extension diff --git a/ooo.lst.in b/ooo.lst.in index 94d69c21d5ea..f20a385e956d 100644 --- a/ooo.lst.in +++ b/ooo.lst.in @@ -90,4 +90,13 @@ http://ooo.itc.hu/oxygenoffice/download/libreoffice/ @OOOP_TEMPLATES_PACK@ @OOOP_FONTS_PACK@ @OOOP_SAMPLES_PACK@ +@CT2N_EXTENSION_PACK@ +@BARCODE_EXTENSION_PACK@ +@DIAGRAM_EXTENSION_PACK@ +@VALIDATOR_EXTENSION_PACK@ +@WATCH_WINDOW_EXTENSION_PACK@ +@NUMBERTEXT_EXTENSION_PACK@ +@HUNART_EXTENSION_PACK@ +@TYPO_EXTENSION_PACK@ +@GOOGLE_DOCS_EXTENSION_PACK@ -- cgit v1.2.3 From 64dec765d887aec38fcc754054178720aa10a351 Mon Sep 17 00:00:00 2001 From: Kalman Szalai - KAMI Date: Sun, 24 Apr 2011 10:53:35 +0200 Subject: Add copy and extract for extras and few extensions --- download | 30 ++++++++++++++++++++++++++++++ set_soenv.in | 13 +++++++++++++ 2 files changed, 43 insertions(+) diff --git a/download b/download index 45c356c79220..abe4c7942094 100755 --- a/download +++ b/download @@ -34,6 +34,18 @@ fi # we want to clone if we are in the bootstrap git repo and clone does not exist yet # we need to test for a .git in order not to clone after rsync if we are called in # the inner autogen of the buid-repo based build + +check_file() +{ + echo "Looking for $1 ..." + if test -f $1; then + echo "ok" + else + echo "missing required archive; run './download' again"; + exit 1; + fi +} + if [ -d .git ] ; then if [ -z "$GIT_LINK_SRC" ]; then ./g -f clone @@ -276,6 +288,24 @@ if [ "$GUI" = "WNT" -a -n "$md5sum" ]; then fi fi +# OxygenOffice extras +echo "Unpacking OxygenOffice extras ..." +for pack in $OOOP_FONTS_PACK $OOOP_GALLERY_PACK $OOOP_SAMPLES_PACK $OOOP_TEMPLATES_PACK ; do + check_file $TARFILE_LOCATION/$pack + echo "Unpacking $pack ..." + unzip -o -q $TARFILE_LOCATION/$pack -d $SRC_ROOT/extras/source +done + +# Extensions copy +echo "Copy extensions to their location ..." +for pack in $BARCODE_EXTENSION_PACK $DIAGRAM_EXTENSION_PACK $VALIDATOR_EXTENSION_PACK $WATCH_WINDOW_EXTENSION_PACK $NUMBERTEXT_EXTENSION_PACK $HUNART_EXTENSION_PACK $TYPO_EXTENSION_PACK $GOOGLE_DOCS_EXTENSION_PACK ; do + check_file $TARFILE_LOCATION/$pack + packfilename=`echo "$pack" | cut --only-delimited --delimiter=- --fields=2 | cut --delimiter=_ --fields=1` + echo "Copy extension: '$pack' as '$packfilename.oxt' ..." + mkdir -p $SRC_ROOT/extras/source/extensions/ || exit 1 + cp $TARFILE_LOCATION/$pack $SRC_ROOT/extras/source/extensions/$packfilename.oxt || exit 1 +done + [ -x "post_download" ] || { echo "'post_download' script not found, run ./autogen.sh." ; exit 1 ; } ./post_download || exit 1 diff --git a/set_soenv.in b/set_soenv.in index a1bd947380de..522de78b27fb 100755 --- a/set_soenv.in +++ b/set_soenv.in @@ -1874,6 +1874,19 @@ ToFile( "MOZ_NSPR_CFLAGS", "@MOZ_NSPR_CFLAGS@", "e" ); ToFile( "MOZ_NSS_CFLAGS", "@MOZ_NSS_CFLAGS@", "e" ); ToFile( "MOZ_NSS_LIBS", "@MOZ_NSS_LIBS@", "e" ); ToFile( "MOZ_LDAP_CFLAGS", "@MOZ_LDAP_CFLAGS@", "e" ); +ToFile( "OOOP_GALLERY_PACK", "@OOOP_GALLERY_PACK@","e" ); +ToFile( "OOOP_TEMPLATES_PACK", "@OOOP_TEMPLATES_PACK@","e" ); +ToFile( "OOOP_FONTS_PACK", "@OOOP_FONTS_PACK@","e" ); +ToFile( "OOOP_SAMPLES_PACK", "@OOOP_SAMPLES_PACK@","e" ); +ToFile( "CT2N_EXTENSION_PACK", "@CT2N_EXTENSION_PACK@","e" ); +ToFile( "BARCODE_EXTENSION_PACK", "@BARCODE_EXTENSION_PACK@","e" ); +ToFile( "DIAGRAM_EXTENSION_PACK", "@DIAGRAM_EXTENSION_PACK@","e" ); +ToFile( "VALIDATOR_EXTENSION_PACK", "@VALIDATOR_EXTENSION_PACK@","e" ); +ToFile( "WATCH_WINDOW_EXTENSION_PACK", "@WATCH_WINDOW_EXTENSION_PACK@","e" ); +ToFile( "NUMBERTEXT_EXTENSION_PACK", "@NUMBERTEXT_EXTENSION_PACK@","e" ); +ToFile( "HUNART_EXTENSION_PACK", "@HUNART_EXTENSION_PACK@","e" ); +ToFile( "TYPO_EXTENSION_PACK", "@TYPO_EXTENSION_PACK@","e" ); +ToFile( "GOOGLE_DOCS_EXTENSION_PACK", "@GOOGLE_DOCS_EXTENSION_PACK@","e" ); ToFile( "WITH_FONTS", "@WITH_FONTS@", "e" ); ToFile( "WITH_AGFA_MONOTYPE_FONTS", "@WITH_AGFA_MONOTYPE_FONTS@", "e" ); ToFile( "WITHOUT_AFMS", "@WITHOUT_AFMS@", "e" ); -- cgit v1.2.3 From fcffdd382b93942d488b6d7108bf97a8286e402d Mon Sep 17 00:00:00 2001 From: Kalman Szalai - KAMI Date: Wed, 4 May 2011 04:54:34 +0200 Subject: Remove already integrated fonts from extra fonts --- scp2/source/accessories/file_font_accessories.scp | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/scp2/source/accessories/file_font_accessories.scp b/scp2/source/accessories/file_font_accessories.scp index 2683ed978d4b..9adbe4bdfacf 100644 --- a/scp2/source/accessories/file_font_accessories.scp +++ b/scp2/source/accessories/file_font_accessories.scp @@ -880,22 +880,3 @@ STD_FONT_FILE( gid_File_Fnt_Verina_Serif_Bold, Verina_Serif_Bold.otf, Verina Ser STD_FONT_FILE( gid_File_Fnt_Verina_Serif, Verina_Serif.otf, Verina Serif ) #endif -#ifdef WITH_EXTRA_FONT -STD_FONT_FILE( gid_File_Fnt_MagyarLinBiolinum, MagyarLinBiolinum.ttf, Magyar Linux Biolinum) -STD_FONT_FILE( gid_File_Fnt_MagyarLinBiolinumB, MagyarLinBiolinumB.ttf, Magyar Linux Biolinum Bold) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertine, MagyarLinLibertine.ttf, Magyar Linux Libertine) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineB, MagyarLinLibertineB.ttf, Magyar Linux Libertine Bold) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineBI, MagyarLinLibertineBI.ttf, Magyar Linux Libertine Bold Italic) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineC, MagyarLinLibertineC_Re.ttf, Magyar Linux Libertine Capital) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineG, MagyarLinLibertineG.ttf, Magyar Linux Libertine Graphite) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineGB, MagyarLinLibertineGB.ttf, Magyar Linux Libertine Bold Graphite) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineGBI, MagyarLinLibertineGBI.ttf, Magyar Linux Libertine Bold Italic Graphite) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineGI, MagyarLinLibertineGI.ttf, Magyar Linux Libertine Italic Graphite) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineI, MagyarLinLibertineI.ttf, Magyar Linux Libertine Italic) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineN, MagyarLinLibertineN.ttf, Magyar Linux N Libertine) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineNB, MagyarLinLibertineNB.ttf, Magyar Linux Libertine N Bold) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineNBI, MagyarLinLibertineNBI.ttf, Magyar Linux Libertine N Bold Italic) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineNI, MagyarLinLibertineNI.ttf, Magyar Linux Libertine N Italic) -STD_FONT_FILE( gid_File_Fnt_MagyarLinLibertineNC, MagyarLinLibertineNC_Re.ttf, Magyar Linux Libertine N Capital) -#endif - -- cgit v1.2.3 From ca718e36f189fd6ac941491757fec3f06e897c7a Mon Sep 17 00:00:00 2001 From: Kalman Szalai - KAMI Date: Wed, 4 May 2011 04:55:31 +0200 Subject: Refine lication of OxygenOffice splash --- distro-configs/OxygenOfficeLinux.conf | 2 ++ distro-configs/OxygenOfficeWin32.conf | 2 ++ 2 files changed, 4 insertions(+) diff --git a/distro-configs/OxygenOfficeLinux.conf b/distro-configs/OxygenOfficeLinux.conf index d2050eb0009d..a1a432737041 100644 --- a/distro-configs/OxygenOfficeLinux.conf +++ b/distro-configs/OxygenOfficeLinux.conf @@ -1,5 +1,7 @@ --with-vendor=OxygenOffice Professional Team --with-build-version=OxygenOffice Professional Beta 3.4.0 M000 - OxygenOffice Build 0 +--with-intro-bitmap=$TARFILE_LOCATION/openintro_ooop.png +--with-about-bitmap=$TARFILE_LOCATION/openabout_ooop.png --enable-binfilter --enable-vba --enable-build-mozilla diff --git a/distro-configs/OxygenOfficeWin32.conf b/distro-configs/OxygenOfficeWin32.conf index 45927e0dd351..ba6f999b653c 100644 --- a/distro-configs/OxygenOfficeWin32.conf +++ b/distro-configs/OxygenOfficeWin32.conf @@ -1,5 +1,7 @@ --with-vendor=OxygenOffice Professional Team --with-build-version=OxygenOffice Professional Beta 3.4.0 M000 - OxygenOffice Build 0 +--with-intro-bitmap=$TARFILE_LOCATION/openintro_ooop.png +--with-about-bitmap=$TARFILE_LOCATION/openabout_ooop.png --enable-binfilter --enable-vba --disable-build-mozilla -- cgit v1.2.3 From 9aad2b0d3d226b3c6ce61501f1f5efc0097fc429 Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Wed, 4 May 2011 13:40:12 +0800 Subject: Click ellipse and rectangle icons using .uno.BasicShapes. The .uno.Ellipse and .uno.Rect object in Toolbar is not clickable now caused by the fix: http://cgit.freedesktop.org/libreoffice/impress/commit/ \ ?h=libreoffice-3-4&id=d31b6292b14546ac7b04b4f483b70f68b56412e6 Thanks Yifan Jiang for testing. --- testautomation/global/win/bars.win | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testautomation/global/win/bars.win b/testautomation/global/win/bars.win index 9bd0d252cd55..850baef4f598 100644 --- a/testautomation/global/win/bars.win +++ b/testautomation/global/win/bars.win @@ -1231,7 +1231,7 @@ DruckLayout .uno:PrintLayout Effekt .uno:EffectWindow Edit .uno:EditDoc Einfuegen .uno:InsertCtrl -Ellipsen .uno:Ellipse +Ellipsen .uno:BasicShapes.ellipse ExecuteBtn .uno:SbaExecuteSql Feldbefehle .uno:InsertFieldCtrl Filter .uno:DataFilterStandardFilter @@ -1271,7 +1271,7 @@ OnlineLayout .uno:BrowseView Paste .uno:Paste Praesentation .uno:Presentation PrintDefault .uno:PrintDefault -Rechteck .uno:Rect +Rechteck .uno:BasicShapes.rectangle Rechtschreibung .uno:Spelling RecSearch .uno:RecSearch RecSave .uno:RecSave -- cgit v1.2.3 From fafc7e0547c1cff6f18b0b60dd44749768250691 Mon Sep 17 00:00:00 2001 From: Katarina Machalkova Date: Wed, 4 May 2011 11:49:38 +0200 Subject: Check for existence of property before retrieving its value Is[Empty]PresentationObject prop seems not to be set in Calc/Writer shape objects and retrieving its value throws an exception. This fixes export of xlsx docs with embedded pics/charts. (cherry picked from commit dd719060ab7ba487aff70bbf21418a2c2fb9cce6) --- oox/source/export/shapes.cxx | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 224b15068353..a8c838ddd1e6 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -76,6 +77,7 @@ #include using namespace ::com::sun::star; +using namespace ::com::sun::star::beans; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::drawing; using namespace ::com::sun::star::i18n; @@ -105,6 +107,7 @@ using ::sax_fastparser::FSHelperPtr; #define IDS(x) (OString(#x " ") + OString::valueOf( mnShapeIdMax++ )).getStr() + struct CustomShapeTypeTranslationTable { const char* sOOo; @@ -408,17 +411,34 @@ awt::Size ShapeExport::MapSize( const awt::Size& rSize ) const sal_Bool ShapeExport::NonEmptyText( Reference< XShape > xShape ) { Reference< XPropertySet > xPropSet( xShape, UNO_QUERY ); - sal_Bool bIsEmptyPresObj = sal_False; - if( xPropSet.is() && ( xPropSet->getPropertyValue( S( "IsEmptyPresentationObject" ) ) >>= bIsEmptyPresObj ) ) { - DBG(printf("empty presentation object %d, props:\n", bIsEmptyPresObj)); - if( bIsEmptyPresObj ) - return sal_True; - } - sal_Bool bIsPresObj = sal_False; - if( xPropSet.is() && ( xPropSet->getPropertyValue( S( "IsPresentationObject" ) ) >>= bIsPresObj ) ) { - DBG(printf("presentation object %d, props:\n", bIsPresObj)); - if( bIsPresObj ) - return sal_True; + + if( xPropSet.is() ) + { + Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); + if ( xPropSetInfo.is() ) + { + if ( xPropSetInfo->hasPropertyByName( S( "IsEmptyPresentationObject" ) ) ) + { + sal_Bool bIsEmptyPresObj = sal_False; + if ( xPropSet->getPropertyValue( S( "IsEmptyPresentationObject" ) ) >>= bIsEmptyPresObj ) + { + DBG(printf("empty presentation object %d, props:\n", bIsEmptyPresObj)); + if( bIsEmptyPresObj ) + return sal_True; + } + } + + if ( xPropSetInfo->hasPropertyByName( S( "IsEmptyPresentationObject" ) ) ) + { + sal_Bool bIsPresObj = sal_False; + if ( xPropSet->getPropertyValue( S( "IsPresentationObject" ) ) >>= bIsPresObj ) + { + DBG(printf("presentation object %d, props:\n", bIsPresObj)); + if( bIsPresObj ) + return sal_True; + } + } + } } Reference< XSimpleText > xText( xShape, UNO_QUERY ); -- cgit v1.2.3 From 60aa5634e70fb5f3b0c7272b135456907d67a03e Mon Sep 17 00:00:00 2001 From: Katarina Machalkova Date: Wed, 4 May 2011 13:49:31 +0200 Subject: Copy&pasting is considered harmful (cherry picked from commit 930824ebb65245e7f6630888379bb71438e63cf2) --- oox/source/export/shapes.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index a8c838ddd1e6..8bd8a3985fa5 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -428,7 +428,7 @@ sal_Bool ShapeExport::NonEmptyText( Reference< XShape > xShape ) } } - if ( xPropSetInfo->hasPropertyByName( S( "IsEmptyPresentationObject" ) ) ) + if ( xPropSetInfo->hasPropertyByName( S( "IsPresentationObject" ) ) ) { sal_Bool bIsPresObj = sal_False; if ( xPropSet->getPropertyValue( S( "IsPresentationObject" ) ) >>= bIsPresObj ) -- cgit v1.2.3 From 6a47e3b6427264429d571a8356a9e0d2af790884 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 4 May 2011 15:29:53 -0400 Subject: fdo#36849: Assume that the range list member may be NULL. --- sc/source/core/data/conditio.cxx | 18 +++++++++++++----- sc/source/ui/view/viewfunc.cxx | 9 ++++++--- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 40390816128b..2668893ed4d3 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1270,7 +1270,8 @@ ScConditionalFormat::ScConditionalFormat(const ScConditionalFormat& r) : pAreas( NULL ), nKey( r.nKey ), ppEntries( NULL ), - nEntryCount( r.nEntryCount ) + nEntryCount( r.nEntryCount ), + pRanges( NULL ) { if (nEntryCount) { @@ -1281,7 +1282,8 @@ ScConditionalFormat::ScConditionalFormat(const ScConditionalFormat& r) : ppEntries[i]->SetParent(this); } } - pRanges = new ScRangeList( *r.pRanges ); + if (r.pRanges) + pRanges = new ScRangeList( *r.pRanges ); } ScConditionalFormat* ScConditionalFormat::Clone(ScDocument* pNewDoc) const @@ -1320,10 +1322,16 @@ sal_Bool ScConditionalFormat::EqualEntries( const ScConditionalFormat& r ) const if ( ! (*ppEntries[i] == *r.ppEntries[i]) ) return false; - if( *pRanges != *r.pRanges ) - return false; + if (pRanges) + { + if (r.pRanges) + return *pRanges == *r.pRanges; + else + return false; + } - return true; + // pRanges is NULL, which means r.pRanges must be NULL. + return r.pRanges.Is() == false; } void ScConditionalFormat::AddRangeInfo( const ScRangeListRef& rRanges ) diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 2918410d0923..cc85ef7b7137 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -97,10 +97,13 @@ static void lcl_PostRepaintCondFormat( const ScConditionalFormat *pCondFmt, ScDo { if( pCondFmt ) { - const ScRangeListRef& aRanges = pCondFmt->GetRangeInfo(); - size_t nCount = aRanges->size(); + const ScRangeListRef& xRanges = pCondFmt->GetRangeInfo(); + if (!xRanges) + return; + + size_t nCount = xRanges->size(); for( size_t n = 0 ; n < nCount; n++ ) - pDocSh->PostPaint( *((*aRanges)[n]), PAINT_ALL ); + pDocSh->PostPaint( *((*xRanges)[n]), PAINT_ALL ); } } -- cgit v1.2.3 From c5e7b30a5fc39405ed0ac058ef1b852fd7667f73 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 4 May 2011 20:27:43 +0100 Subject: fix fdo#36838 by avoiding -L argument to pagein --- desktop/source/pagein/pagein.c | 15 ++++++++++++--- desktop/unx/source/args.c | 8 ++++---- desktop/unx/source/start.c | 42 ++++++++++++++++++++++++++++-------------- 3 files changed, 44 insertions(+), 21 deletions(-) diff --git a/desktop/source/pagein/pagein.c b/desktop/source/pagein/pagein.c index 3ba12f9437a2..947b4b7375d5 100755 --- a/desktop/source/pagein/pagein.c +++ b/desktop/source/pagein/pagein.c @@ -107,16 +107,25 @@ int pagein_execute (int argc, char **argv) if ((argv[i][0] == '@') && ((fp = fopen (argv[i], "r")) == 0)) { - char path[1024]; + char fullpath[4096]; + char *path; + strncpy (fullpath, argv[i] + 1, 3000); + if (!(path = strrchr (fullpath, '/'))) + path = fullpath; + else + path++; + if ((fp = fopen (&(argv[i][1]), "r")) == 0) { fprintf (stderr, "fopen %s: %s\n", &(argv[i][1]), strerror(errno)); continue; } - while (fgets (path, sizeof(path), fp) != 0) + while (fgets (path, 1024, fp) != 0) { path[strlen(path) - 1] = '\0', k = 0; - if (do_pagein (path, &k) == 0) + + /* paths relative to the location of the pagein file */ + if (do_pagein (fullpath, &k) == 0) { /* accumulate total size */ nbytes += k; diff --git a/desktop/unx/source/args.c b/desktop/unx/source/args.c index 0f47f791d5eb..d69fe62e2466 100644 --- a/desktop/unx/source/args.c +++ b/desktop/unx/source/args.c @@ -61,10 +61,10 @@ static struct { { "minimized", 0, 1, 0, 0, NULL }, /* pagein bits */ - { "writer", 0, 0, 0, 0, "@pagein-writer" }, - { "calc", 0, 0, 0, 0, "@pagein-calc" }, - { "draw", 0, 0, 0, 0, "@pagein-draw" }, - { "impress", 0, 0, 0, 0, "@pagein-impress" }, + { "writer", 0, 0, 0, 0, "pagein-writer" }, + { "calc", 0, 0, 0, 0, "pagein-calc" }, + { "draw", 0, 0, 0, 0, "pagein-draw" }, + { "impress", 0, 0, 0, 0, "pagein-impress" }, /* nothing much */ { "version", 0, 1, 1, 1, NULL }, diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c index e81cd6129d0a..b3042f75ea24 100755 --- a/desktop/unx/source/start.c +++ b/desktop/unx/source/start.c @@ -728,6 +728,24 @@ system_checks( void ) /* re-use the pagein code */ extern int pagein_execute (int argc, char **argv); +#define REL_PATH "/../basis-link/program" +static char *build_pagein_path (Args *args, const char *pagein_name) +{ + char *path; + rtl_String *app_path; + + app_path = ustr_to_str (args->pAppPath); + path = malloc (app_path->length + strlen (pagein_name) + sizeof (REL_PATH) + 8); + strcpy (path, "@"); + strcpy (path + 1, rtl_string_getStr (app_path)); + strcat (path, "/../basis-link/program/"); + strcat (path, pagein_name); + + rtl_string_release( app_path ); + + return path; +} + void exec_pagein (Args *args) { @@ -735,24 +753,20 @@ exec_pagein (Args *args) #ifdef MACOSX (void)args; #else - char *argv[5]; - rtl_String *app_path; - - app_path = ustr_to_str (args->pAppPath); + char *argv[3]; + /* don't use -L - since that does a chdir that breaks relative paths */ argv[0] = "dummy-pagein"; - argv[1] = malloc (app_path->length + sizeof ("-L/../basis-link/program") + 2); - strcpy (argv[1], "-L"); - strcat (argv[1], app_path->buffer); - strcat (argv[1], "/../basis-link/program"); - argv[2] = "@pagein-common"; - argv[3] = (char *)args->pPageinType; - argv[4] = NULL; - - rtl_string_release( app_path ); + argv[1] = build_pagein_path (args, "pagein-common"); + if (args->pPageinType) { + argv[2] = build_pagein_path (args, args->pPageinType); + } else + argv[2] = NULL; - pagein_execute (args->pPageinType ? 4 : 3, argv); + pagein_execute (args->pPageinType ? 3 : 2, argv); + if (argv[2]) + free (argv[2]); free (argv[1]); #endif } -- cgit v1.2.3 From 8097d32e002f21bd478b8e9ccba7cf4d4451fcda Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 4 May 2011 16:27:16 -0400 Subject: fdo#33137: Fixed external references with COUNTIF. --- sc/source/core/tool/interpr1.cxx | 36 ++++++++++++++++++++---------------- sc/source/core/tool/interpr4.cxx | 8 ++------ 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 476eb6ef2cb0..6aa15fcba02a 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -4603,7 +4603,9 @@ void ScInterpreter::ScCountIf() } } break; - case svMatrix : + case svMatrix: + case svExternalSingleRef: + case svExternalDoubleRef: { ScMatValType nType = GetDoubleOrStringFromMatrix( fVal, rString); @@ -4648,23 +4650,25 @@ void ScInterpreter::ScCountIf() nTab2 = nTab1; break; case svMatrix: + case svExternalSingleRef: + case svExternalDoubleRef: + { + pQueryMatrix = GetMatrix(); + if (!pQueryMatrix) { - pQueryMatrix = PopMatrix(); - if (!pQueryMatrix) - { - PushIllegalParameter(); - return; - } - nCol1 = 0; - nRow1 = 0; - nTab1 = 0; - SCSIZE nC, nR; - pQueryMatrix->GetDimensions( nC, nR); - nCol2 = static_cast(nC - 1); - nRow2 = static_cast(nR - 1); - nTab2 = 0; + PushIllegalParameter(); + return; } - break; + nCol1 = 0; + nRow1 = 0; + nTab1 = 0; + SCSIZE nC, nR; + pQueryMatrix->GetDimensions( nC, nR); + nCol2 = static_cast(nC - 1); + nRow2 = static_cast(nR - 1); + nTab2 = 0; + } + break; default: PushIllegalParameter(); return ; diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 1c7ecdd33c78..551a1c2e94ab 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -2350,13 +2350,9 @@ ScMatValType ScInterpreter::GetDoubleOrStringFromMatrix( double& rDouble, ScMatrixRef pMat; StackVar eType = GetStackType(); - if (eType == svExternalDoubleRef) + if (eType == svExternalDoubleRef || eType == svExternalSingleRef || eType == svMatrix) { - PopExternalDoubleRef(pMat); - } - else if (eType == svMatrix) - { - pMat = PopMatrix(); + pMat = GetMatrix(); } else { -- cgit v1.2.3 From a5ea69b9de3a7b1204c2512bb1e03778c86a5cc5 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 4 May 2011 18:47:36 -0400 Subject: Properly close the document shell when erased from the manager. Because the document shell object was erased without properly having its shell closed, it failed to update the values when the link was updated, especially when the source document was open. Closing it properly when its object is erased should fix it. --- sc/source/ui/docshell/externalrefmgr.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index f9de3e8c0c48..fc12cf1a8681 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -2358,9 +2358,14 @@ void lcl_removeByFileId(sal_uInt16 nFileId, MapContainer& rMap) { typename MapContainer::iterator itr = rMap.find(nFileId); if (itr != rMap.end()) + { + // Close this document shell. + itr->second.maShell->DoClose(); rMap.erase(itr); + } } + void ScExternalRefManager::refreshNames(sal_uInt16 nFileId) { maRefCache.clearCache(nFileId); @@ -2528,6 +2533,9 @@ void ScExternalRefManager::purgeStaleSrcDocument(sal_Int32 nTimeOut) sal_Int32 nSinceLastAccess = (Time() - itr->second.maLastAccess).GetTime(); if (nSinceLastAccess < nTimeOut) aNewDocShells.insert(*itr); + else + // Timed out. Let's close this. + itr->second.maShell->DoClose(); } maDocShells.swap(aNewDocShells); -- cgit v1.2.3 From 75a87836d75100fc4da446e9ce57a0862b6f0295 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 4 May 2011 19:37:28 -0400 Subject: fdo#36848: Typing a named range in the position window should jump. --- sc/source/ui/app/inputwin.cxx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index c03799aa6ffe..8cb3d6e136e8 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1533,7 +1533,7 @@ ScNameInputType lcl_GetInputType( const String& rText ) sal_Int32 nNumeric; if ( aRange.Parse( rText, pDoc, eConv ) & SCA_VALID ) - eRet = SC_NAME_INPUT_NAMEDRANGE; + eRet = SC_NAME_INPUT_RANGE; else if ( aAddress.Parse( rText, pDoc, eConv ) & SCA_VALID ) eRet = SC_NAME_INPUT_CELL; else if ( aRangeUtil.MakeRangeFromName( rText, pDoc, nTab, aRange, RUTL_NAMES, eConv ) ) @@ -1697,11 +1697,14 @@ void ScPosWnd::DoEnter() else { // for all selection types, excecute the SID_CURRENTCELL slot. - // Note that SID_CURRENTCELL always expects address to be - // in Calc A1 format. Convert the text. - ScRange aRange; - aRange.ParseAny(aText, pDoc, pDoc->GetAddressConvention()); - aRange.Format(aText, SCR_ABS_3D, pDoc, ::formula::FormulaGrammar::CONV_OOO); + if (eType == SC_NAME_INPUT_CELL || eType == SC_NAME_INPUT_RANGE) + { + // Note that SID_CURRENTCELL always expects address to + // be in Calc A1 format. Convert the text. + ScRange aRange; + aRange.ParseAny(aText, pDoc, pDoc->GetAddressConvention()); + aRange.Format(aText, SCR_ABS_3D, pDoc, ::formula::FormulaGrammar::CONV_OOO); + } SfxStringItem aPosItem( SID_CURRENTCELL, aText ); SfxBoolItem aUnmarkItem( FN_PARAM_1, sal_True ); // remove existing selection -- cgit v1.2.3 From dafbd8ef18252e18c6622ee636b0f5ee0a84bfcd Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 4 May 2011 22:05:51 -0400 Subject: Added unit test for PRODUCT cell function with inline array. 3.3.2 didn't calculate this correctly. --- sc/qa/unit/ucalc.cxx | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 35558d1a75a3..8c3c37ecc726 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -224,7 +224,7 @@ public: void testCollator(); void testInput(); - void testSUM(); + void testCellFunctions(); void testVolatileFunc(); void testFuncParam(); void testNamedRange(); @@ -264,7 +264,7 @@ public: CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST(testCollator); CPPUNIT_TEST(testInput); - CPPUNIT_TEST(testSUM); + CPPUNIT_TEST(testCellFunctions); CPPUNIT_TEST(testVolatileFunc); CPPUNIT_TEST(testFuncParam); CPPUNIT_TEST(testNamedRange); @@ -398,11 +398,13 @@ void Test::testInput() m_pDoc->DeleteTab(0); } -void Test::testSUM() +void Test::testCellFunctions() { rtl::OUString aTabName(RTL_CONSTASCII_USTRINGPARAM("foo")); CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet", m_pDoc->InsertTab (0, aTabName)); + + // SUM double val = 1; m_pDoc->SetValue (0, 0, 0, val); m_pDoc->SetValue (0, 1, 0, val); @@ -412,6 +414,23 @@ void Test::testSUM() m_pDoc->GetValue (0, 2, 0, result); CPPUNIT_ASSERT_MESSAGE ("calculation failed", result == 2.0); + // PRODUCT + val = 1; + m_pDoc->SetValue(0, 0, 0, val); + val = 2; + m_pDoc->SetValue(0, 1, 0, val); + val = 3; + m_pDoc->SetValue(0, 2, 0, val); + m_pDoc->SetString(0, 3, 0, OUString(RTL_CONSTASCII_USTRINGPARAM("=PRODUCT(A1:A3)"))); + m_pDoc->CalcAll(); + m_pDoc->GetValue(0, 3, 0, result); + CPPUNIT_ASSERT_MESSAGE("Calculation of PRODUCT failed", result == 6.0); + + m_pDoc->SetString(0, 4, 0, OUString(RTL_CONSTASCII_USTRINGPARAM("=PRODUCT({1;2;3})"))); + m_pDoc->CalcAll(); + m_pDoc->GetValue(0, 4, 0, result); + CPPUNIT_ASSERT_MESSAGE("Calculation of PRODUCT with inline array failed", result == 6.0); + m_pDoc->DeleteTab(0); } -- cgit v1.2.3 From f8670c4237598cb46486fc7480dcde1c94c95cdc Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 5 May 2011 00:23:25 -0400 Subject: fdo#36406: Let's not use invalidated iterators. std::set::erase(iterator) call invalidates the iterator of the erased element. We better not use it after the erase() call. Since the number of manual breaks should not be high enough to cause a performance bottleneck under normal usage, a safer linear copy should just be fine. Now, I'm not sure if this indeed is the cause of the erroneous amount of manual breaks in the test document, but I didn't see any other likely spot. --- sc/source/core/data/table2.cxx | 46 ++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 646be060b6a9..e711fd270f61 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -157,18 +157,17 @@ void ScTable::InsertRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE if (!maRowManualBreaks.empty()) { - std::set::reverse_iterator rit = maRowManualBreaks.rbegin(); - while (rit != maRowManualBreaks.rend()) - { - SCROW nRow = *rit; - if (nRow < nStartRow) - break; // while - else - { - maRowManualBreaks.erase( (++rit).base()); - maRowManualBreaks.insert( static_cast( nRow + nSize)); - } - } + // Copy all breaks up to nStartRow (non-inclusive). + ::std::set::const_iterator itr1 = maRowManualBreaks.lower_bound(nStartRow); + ::std::set aNewBreaks(maRowManualBreaks.begin(), itr1); + + // Copy all breaks from nStartRow (inclusive) to the last element, + // but add nSize to each value. + ::std::set::const_iterator itr2 = maRowManualBreaks.end(); + for (; itr1 != itr2; ++itr1) + aNewBreaks.insert(static_cast(*itr1 + nSize)); + + maRowManualBreaks.swap(aNewBreaks); } } @@ -208,14 +207,21 @@ void ScTable::DeleteRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE if (!maRowManualBreaks.empty()) { - std::set::iterator it = maRowManualBreaks.upper_bound( static_cast( nStartRow + nSize - 1)); - maRowManualBreaks.erase( maRowManualBreaks.lower_bound( nStartRow), it); - while (it != maRowManualBreaks.end()) - { - SCROW nRow = *it; - maRowManualBreaks.erase( it++); - maRowManualBreaks.insert( static_cast( nRow - nSize)); - } + // Erase all manual breaks between nStartRow and nStartRow + nSize - 1 (inclusive). + std::set::iterator itr1 = maRowManualBreaks.lower_bound(nStartRow); + std::set::iterator itr2 = maRowManualBreaks.upper_bound(static_cast(nStartRow + nSize - 1)); + maRowManualBreaks.erase(itr1, itr2); + + // Copy all breaks from the 1st element up to nStartRow to the new container. + itr1 = maRowManualBreaks.lower_bound(nStartRow); + ::std::set aNewBreaks(maRowManualBreaks.begin(), itr1); + + // Copy all breaks from nStartRow to the last element, but subtract each value by nSize. + itr2 = maRowManualBreaks.end(); + for (; itr1 != itr2; ++itr1) + aNewBreaks.insert(static_cast(*itr1 - nSize)); + + maRowManualBreaks.swap(aNewBreaks); } } -- cgit v1.2.3 From 708def7d94bb76ef137572a364d2643402dc590b Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Thu, 5 May 2011 07:50:18 +0200 Subject: Fix ooinstall -l case Removing destdir prefix for dev-install case is not a good idea --- solenv/bin/ooinstall | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/solenv/bin/ooinstall b/solenv/bin/ooinstall index 4afdb23d0133..89aea81a6741 100755 --- a/solenv/bin/ooinstall +++ b/solenv/bin/ooinstall @@ -28,11 +28,13 @@ for $arg (@ARGV) { } elsif ($arg eq '-h' || $arg eq '--help') { $help = 1; } else { - # Cwd::realpath does not work if the path does not exist - mkpath($ENV{DESTDIR} . $arg) unless -d $ENV{DESTDIR} . $arg; - $path = Cwd::realpath( $ENV{DESTDIR} . $arg ); - my $destdir = Cwd::realpath( $ENV{DESTDIR} ); - $path =~ s|$destdir||; + # Cwd::realpath does not work if the path does not exist + mkpath($ENV{DESTDIR} . $arg) unless -d $ENV{DESTDIR} . $arg; + $path = Cwd::realpath( $ENV{DESTDIR} . $arg ); + if (!$do_link) { + my $destdir = Cwd::realpath( $ENV{DESTDIR} ); + $path =~ s|$destdir||; + } } } -- cgit v1.2.3 From 25bff3759e414f96a03b8bc9cb867020cf99cb76 Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Thu, 5 May 2011 10:13:49 +0200 Subject: fdo#36727: use gb_Deliver_deliver to deliver to OUTDIR --- svx/AllLangResTarget_svx.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/svx/AllLangResTarget_svx.mk b/svx/AllLangResTarget_svx.mk index 8b976275694a..85c9167b88cc 100644 --- a/svx/AllLangResTarget_svx.mk +++ b/svx/AllLangResTarget_svx.mk @@ -109,8 +109,8 @@ ifeq ($(strip $(WITH_LANG)),) $(WORKDIR)/inc/svx/globlmn.hrc : $(SRCDIR)/svx/inc/globlmn_tmpl.hrc echo copying $@ -mkdir -p $(WORKDIR)/inc/svx - cp $(SRCDIR)/svx/inc/globlmn_tmpl.hrc $(WORKDIR)/inc/svx/globlmn.hrc - cp $(SRCDIR)/svx/inc/globlmn_tmpl.hrc $(OUTDIR)/inc/svx/globlmn.hrc + cp $< $@ + $(call gb_Deliver_deliver, $@, $(OUTDIR)/inc/svx/globlmn.hrc) rm -f $(WORKDIR)/inc/svx/lastrun.mk else -include $(WORKDIR)/inc/svx/lastrun.mk @@ -126,7 +126,7 @@ $(WORKDIR)/inc/svx/globlmn.hrc : $(SRCDIR)/svx/inc/globlmn_tmpl.hrc $(gb_SrsPart $(gb_SrsPartMergeTarget_TRANSEXCOMMAND) \ -p svx \ -i $< -o $@ -m $(gb_SrsPartMergeTarget_SDFLOCATION)/svx/inc/localize.sdf -l all) - cp $(WORKDIR)/inc/svx/globlmn.hrc $(OUTDIR)/inc/svx/globlmn.hrc + $(call gb_Deliver_deliver, $@, $(OUTDIR)/inc/svx/globlmn.hrc) endif .PHONY : $(WORKDIR)/inc/svx/globlmn.hrc_clean -- cgit v1.2.3 From a4d656ad7c9282de2dcc979ccc6b70b095af4922 Mon Sep 17 00:00:00 2001 From: Andras Timar Date: Thu, 5 May 2011 11:00:03 +0200 Subject: use $realpath() --- svx/AllLangResTarget_svx.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/svx/AllLangResTarget_svx.mk b/svx/AllLangResTarget_svx.mk index 85c9167b88cc..0e07698f55f6 100644 --- a/svx/AllLangResTarget_svx.mk +++ b/svx/AllLangResTarget_svx.mk @@ -106,7 +106,7 @@ $(call gb_SrsTarget_get_clean_target,svx/res) : $(WORKDIR)/inc/svx/globlmn.hrc_c # hack !!! # just a temporary - globlmn.hrc about to be removed! ifeq ($(strip $(WITH_LANG)),) -$(WORKDIR)/inc/svx/globlmn.hrc : $(SRCDIR)/svx/inc/globlmn_tmpl.hrc +$(WORKDIR)/inc/svx/globlmn.hrc : $(realpath $(SRCDIR)/svx/inc/globlmn_tmpl.hrc) echo copying $@ -mkdir -p $(WORKDIR)/inc/svx cp $< $@ @@ -117,7 +117,7 @@ else ifneq ($(gb_lastrun_globlmn),MERGED) .PHONY : $(WORKDIR)/inc/svx/globlmn.hrc endif -$(WORKDIR)/inc/svx/globlmn.hrc : $(SRCDIR)/svx/inc/globlmn_tmpl.hrc $(gb_SrsPartMergeTarget_SDFLOCATION)/svx/inc/localize.sdf +$(WORKDIR)/inc/svx/globlmn.hrc : $(realpath $(SRCDIR)/svx/inc/globlmn_tmpl.hrc) $(gb_SrsPartMergeTarget_SDFLOCATION)/svx/inc/localize.sdf echo merging $@ -mkdir -p $(WORKDIR)/inc/svx rm -f $(WORKDIR)/inc/svx/lastrun.mk -- cgit v1.2.3 From 555cb7a51c5489e65338a32fe0d039fbbb5a4c98 Mon Sep 17 00:00:00 2001 From: Andras Timar Date: Thu, 5 May 2011 11:01:46 +0200 Subject: use $realpath() --- solenv/gbuild/AllLangResTarget.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solenv/gbuild/AllLangResTarget.mk b/solenv/gbuild/AllLangResTarget.mk index 24123d1af125..2db1d80d2ece 100644 --- a/solenv/gbuild/AllLangResTarget.mk +++ b/solenv/gbuild/AllLangResTarget.mk @@ -47,7 +47,7 @@ gb_SrsPartMergeTarget_TRANSEXTARGET := $(call gb_Executable_get_target,transex3) # gb_SrsPartMergeTarget_TRANSEXPRECOMMAND is set by the platforms gb_SrsPartMergeTarget_TRANSEXCOMMAND := $(gb_SrsPartMergeTarget_TRANSEXPRECOMMAND) $(gb_SrsPartMergeTarget_TRANSEXTARGET) -gb_SrsPartMergeTarget_SDFLOCATION := $(SRCDIR)/translations/$(INPATH)/misc/sdf/ +gb_SrsPartMergeTarget_SDFLOCATION := $(realpath $(SRCDIR)/translations/$(INPATH)/misc/sdf/) gb_SrsPartMergeTarget_REPOS := $(gb_REPOS) define gb_SrsPartMergeTarget__command -- cgit v1.2.3 From 825b62a2c64d90c7d5319136f8f3b70493448611 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Thu, 5 May 2011 11:01:04 +0100 Subject: bug 36262 - undo BrOffice branding work --- unotools/source/config/configmgr.cxx | 17 ++++------------- unotools/source/config/makefile.mk | 4 ---- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/unotools/source/config/configmgr.cxx b/unotools/source/config/configmgr.cxx index 97c1776bf95b..69b945b1c754 100644 --- a/unotools/source/config/configmgr.cxx +++ b/unotools/source/config/configmgr.cxx @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #if OSL_DEBUG_LEVEL > 0 @@ -377,18 +376,10 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp) Any aRet; - ::rtl::OUString sBrandName; -#ifdef ENABLE_BROFFICE - LanguageType nType = MsLangId::getRealLanguage( LANGUAGE_NONE ); - if ( nType == LANGUAGE_PORTUGUESE_BRAZILIAN ) - sBrandName = OUString(RTL_CONSTASCII_USTRINGPARAM("BrOffice")); - else -#endif - sBrandName = BrandName::get(); - - if ( eProp == PRODUCTNAME && sBrandName.getLength() ) + ::rtl::OUString &rBrandName = BrandName::get(); + if ( eProp == PRODUCTNAME && rBrandName.getLength() ) { - aRet <<= sBrandName; + aRet <<= rBrandName; return aRet; } @@ -536,7 +527,7 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp) } if ( eProp == PRODUCTNAME ) - aRet >>= sBrandName; + aRet >>= rBrandName; if ( eProp == PRODUCTXMLFILEFORMATNAME ) aRet >>= rXMLFileFormatName; diff --git a/unotools/source/config/makefile.mk b/unotools/source/config/makefile.mk index 9a8e8d2d3d92..d639657eb7c6 100644 --- a/unotools/source/config/makefile.mk +++ b/unotools/source/config/makefile.mk @@ -37,10 +37,6 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk .INCLUDE : $(PRJ)$/util$/makefile.pmk -.IF "$(ENABLE_BROFFICE)"=="TRUE" -CDEFS+=-DENABLE_BROFFICE -.ENDIF - # --- Files ------------------------------------- SLOFILES=\ -- cgit v1.2.3 From 8c26bbeb392fe12e38e75bccc23c0e6ddae021b5 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Thu, 5 May 2011 15:00:31 +0100 Subject: fix fdo#36863 - math crasher on redraw, introduced by Seek difference --- starmath/source/parse.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx index ea015a242661..1aa56358693d 100644 --- a/starmath/source/parse.cxx +++ b/starmath/source/parse.cxx @@ -2513,11 +2513,15 @@ const SmErrorDesc *SmParser::PrevError() } -const SmErrorDesc *SmParser::GetError(size_t i) +const SmErrorDesc *SmParser::GetError(size_t i) { - return ( i < m_aErrDescList.size() ) - ? m_aErrDescList[ i ] - : m_aErrDescList[ m_nCurError ]; + if ( i < m_aErrDescList.size() ) + return m_aErrDescList[ i ]; + + if ( (size_t)m_nCurError < m_aErrDescList.size() ) + return m_aErrDescList[ m_nCurError ]; + + return NULL; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From af3d76c1cc4070da2b4d53576ac757dbd170d118 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Thu, 5 May 2011 16:47:57 +0200 Subject: Auto-accept ccache >= 3.1 on Mac The reason for the selective rejection of everything but a patched ccache on Mac was broken objective-c/c++ support and a memory corruption on arg parse - both are fixed on 3.0 and 3.1, respectively. See http://ccache.samba.org/releasenotes.html --- configure.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 939d567c7a22..3646be8b9675 100755 --- a/configure.in +++ b/configure.in @@ -2901,7 +2901,8 @@ elif test "$enable_ccache_skip" = "auto" ; then # check ccache version AC_MSG_CHECKING([whether version of ccache is suitable]) CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'` - if test "$CCACHE_VERSION" = "2.4_OOo"; then + CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'` + if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then AC_MSG_RESULT([yes]) AC_MSG_CHECKING([whether ccache is actually used for the build]) AC_LANG_PUSH([C++]) -- cgit v1.2.3 From a506b31f99727155303890318614a621e9b8cdb1 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 5 May 2011 10:58:02 -0400 Subject: Let's not use const_iterator here, as MSVC complains about it. --- sc/source/core/data/table2.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index e711fd270f61..c5e2c7644085 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -158,12 +158,12 @@ void ScTable::InsertRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE if (!maRowManualBreaks.empty()) { // Copy all breaks up to nStartRow (non-inclusive). - ::std::set::const_iterator itr1 = maRowManualBreaks.lower_bound(nStartRow); + ::std::set::iterator itr1 = maRowManualBreaks.lower_bound(nStartRow); ::std::set aNewBreaks(maRowManualBreaks.begin(), itr1); // Copy all breaks from nStartRow (inclusive) to the last element, // but add nSize to each value. - ::std::set::const_iterator itr2 = maRowManualBreaks.end(); + ::std::set::iterator itr2 = maRowManualBreaks.end(); for (; itr1 != itr2; ++itr1) aNewBreaks.insert(static_cast(*itr1 + nSize)); -- cgit v1.2.3 From 0f06bf535528324b46ee73e47b0cd9070bbca7b9 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Thu, 5 May 2011 18:39:03 +0200 Subject: fix incorrect merge and remove a useless cast --- sw/source/core/txtnode/fntcap.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx index 8a40614a3d93..5696984a7dce 100644 --- a/sw/source/core/txtnode/fntcap.cxx +++ b/sw/source/core/txtnode/fntcap.cxx @@ -623,7 +623,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo ) pBigFont = pLastFont; // Hier entsteht der Kleinbuchstabenfont: - aFont.SetProportion( sal_uInt8 (aFont.GetPropr() * SMALL_CAPS_PERCENTAGE ) / 100L); + aFont.SetProportion( (aFont.GetPropr() * SMALL_CAPS_PERCENTAGE ) / 100L ); pMagic2 = NULL; nIndex2 = 0; SwFntAccess *pSmallFontAccess = new SwFntAccess( pMagic2, nIndex2, &aFont, -- cgit v1.2.3 From ded180d825d00b24ad8ec063bfeff4dd5bc46ac4 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Thu, 5 May 2011 19:02:59 +0100 Subject: fix for #fdo35706 - ( Ctrl-F & Ctrl-Alt-F don't work in basic IDE ) --- basctl/source/basicide/baside2b.cxx | 9 +++++---- basctl/uiconfig/basicide/toolbar/findbar.xml | 8 ++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 basctl/uiconfig/basicide/toolbar/findbar.xml diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index 7454b1b83358..399f0b700f98 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -411,11 +411,13 @@ void EditorWindow::KeyInput( const KeyEvent& rKEvt ) long nLinSz = pModulWindow->GetHScrollBar()->GetLineSize(); (void)nLinSz; long nThumb = pModulWindow->GetHScrollBar()->GetThumbPos(); (void)nThumb; #endif - sal_Bool bDone = sal_False; sal_Bool bWasModified = pEditEngine->IsModified(); - if ( !TextEngine::DoesKeyChangeText( rKEvt ) || ImpCanModify() ) + // see if there is an accelerator to be processed first + sal_Bool bDone = SfxViewShell::Current()->KeyInput( rKEvt ); + + if ( !bDone && ( !TextEngine::DoesKeyChangeText( rKEvt ) || ImpCanModify() ) ) { - if ( ( rKEvt.GetKeyCode().GetCode() == KEY_A) && rKEvt.GetKeyCode().IsMod1() ) + if ( ( rKEvt.GetKeyCode().GetCode() == KEY_A) && rKEvt.GetKeyCode().IsMod1() && !rKEvt.GetKeyCode().IsMod2() ) pEditView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFFFFFF, 0xFFFF ) ) ); else if ( ( rKEvt.GetKeyCode().GetCode() == KEY_Y ) && rKEvt.GetKeyCode().IsMod1() ) bDone = sal_True; // CTRL-Y schlucken, damit kein Vorlagenkatalog @@ -442,7 +444,6 @@ void EditorWindow::KeyInput( const KeyEvent& rKEvt ) } if ( !bDone ) { - if ( !SfxViewShell::Current()->KeyInput( rKEvt ) ) Window::KeyInput( rKEvt ); } else diff --git a/basctl/uiconfig/basicide/toolbar/findbar.xml b/basctl/uiconfig/basicide/toolbar/findbar.xml new file mode 100644 index 000000000000..0338d3156195 --- /dev/null +++ b/basctl/uiconfig/basicide/toolbar/findbar.xml @@ -0,0 +1,8 @@ + + + + + + + + -- cgit v1.2.3 From 717a07f3d9048ad5f5c08e708ddce4eb12d499e7 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Thu, 5 May 2011 19:05:34 +0100 Subject: fix for #fdo35706 - ( Ctrl-F & Ctrl-Alt-F don't work in basic IDE ) --- .../data/org/openoffice/Office/UI/BasicIDEWindowState.xcu | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/officecfg/registry/data/org/openoffice/Office/UI/BasicIDEWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/BasicIDEWindowState.xcu index ccd1e979fbef..031a01a831a1 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/BasicIDEWindowState.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/BasicIDEWindowState.xcu @@ -146,6 +146,20 @@ true + + + 1,0 + + + 1 + + + Find + + + false + + -- cgit v1.2.3 From 052b1d73876717e01b63b0afa5af4b39534c37dd Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 5 May 2011 17:24:31 -0400 Subject: Get external references to work with MAX and MIN. --- sc/source/core/tool/interpr1.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 6aa15fcba02a..41b5e27b2807 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -2908,8 +2908,10 @@ void ScInterpreter::ScMin( sal_Bool bTextAsZero ) } break; case svMatrix : + case svExternalSingleRef: + case svExternalDoubleRef: { - ScMatrixRef pMat = PopMatrix(); + ScMatrixRef pMat = GetMatrix(); if (pMat) { SCSIZE nC, nR; @@ -3029,8 +3031,10 @@ void ScInterpreter::ScMax( sal_Bool bTextAsZero ) } break; case svMatrix : + case svExternalSingleRef: + case svExternalDoubleRef: { - ScMatrixRef pMat = PopMatrix(); + ScMatrixRef pMat = GetMatrix(); if (pMat) { nFuncFmtType = NUMBERFORMAT_NUMBER; -- cgit v1.2.3 From fb4f96da8c159ad75da3a16e08d1940dd588c1e7 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 5 May 2011 22:46:39 -0400 Subject: Properly cache external reference values in named ranges. Values of the external references used only in named ranges were not cached properly. This commit fixes it. --- sc/source/core/data/documen4.cxx | 85 +++++++++++++++++++++++++++------------- 1 file changed, 57 insertions(+), 28 deletions(-) diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index 1958bf721a4c..b9c79e1c9ebf 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -296,42 +296,71 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // Mehrfachopera pTab[i]->PutCell( j, k, aRefCell.CloneWithoutNote( *this, ScAddress( j, k, i ), SC_CLONECELL_STARTLISTENING ) ); } +namespace { + +bool setCacheTableReferenced(ScToken& rToken, ScExternalRefManager& rRefMgr) +{ + switch (rToken.GetType()) + { + case svExternalSingleRef: + return rRefMgr.setCacheTableReferenced( + rToken.GetIndex(), rToken.GetString(), 1); + case svExternalDoubleRef: + { + const ScComplexRefData& rRef = rToken.GetDoubleRef(); + size_t nSheets = rRef.Ref2.nTab - rRef.Ref1.nTab + 1; + return rRefMgr.setCacheTableReferenced( + rToken.GetIndex(), rToken.GetString(), nSheets); + } + case svExternalName: + /* TODO: external names aren't supported yet, but would + * have to be marked as well, if so. Mechanism would be + * different. */ + DBG_ERRORFILE("ScDocument::MarkUsedExternalReferences: implement the svExternalName case!"); + default: + ; + } + return false; +} + +} + bool ScDocument::MarkUsedExternalReferences( ScTokenArray & rArr ) { + if (!rArr.GetLen()) + return false; + + ScExternalRefManager* pRefMgr = NULL; + rArr.Reset(); + ScToken* t = NULL; bool bAllMarked = false; - if (rArr.GetLen()) + while (!bAllMarked && (t = static_cast(rArr.GetNextReferenceOrName())) != NULL) { - ScExternalRefManager* pRefMgr = NULL; - rArr.Reset(); - ScToken* t; - while (!bAllMarked && (t = static_cast(rArr.GetNextReferenceOrName())) != NULL) + if (t->IsExternalRef()) + { + if (!pRefMgr) + pRefMgr = GetExternalRefManager(); + + bAllMarked = setCacheTableReferenced(*t, *pRefMgr); + } + else if (t->GetType() == svIndex) { - if (t->IsExternalRef()) + // this is a named range. Check if the range contains an external + // reference. + ScRangeData* pRangeData = GetRangeName()->findByIndex(t->GetIndex()); + if (!pRangeData) + continue; + + ScTokenArray* pArray = pRangeData->GetCode(); + for (t = static_cast(pArray->First()); t; t = static_cast(pArray->Next())) { + if (!t->IsExternalRef()) + continue; + if (!pRefMgr) pRefMgr = GetExternalRefManager(); - switch (t->GetType()) - { - case svExternalSingleRef: - bAllMarked = pRefMgr->setCacheTableReferenced( - t->GetIndex(), t->GetString(), 1); - break; - case svExternalDoubleRef: - { - const ScComplexRefData& rRef = t->GetDoubleRef(); - size_t nSheets = rRef.Ref2.nTab - rRef.Ref1.nTab + 1; - bAllMarked = pRefMgr->setCacheTableReferenced( - t->GetIndex(), t->GetString(), nSheets); - } - break; - case svExternalName: - /* TODO: external names aren't supported yet, but would - * have to be marked as well, if so. Mechanism would be - * different. */ - DBG_ERRORFILE("ScDocument::MarkUsedExternalReferences: implement the svExternalName case!"); - break; - default: break; - } + + bAllMarked = setCacheTableReferenced(*t, *pRefMgr); } } } -- cgit v1.2.3 From d27a9990830d5742aa71c241723e2e5a0c050ed4 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 6 May 2011 00:07:35 -0400 Subject: fdo#34930: Remove range names with external references when breaking link. When breaking a link in Edit -> Links, cells containing references to that link get staticized i.e. their formulas replaced with static values. This also applies to cells containing range names that point to external document. We should remove such range names when the link gets broken, or else reloading the document would re-introduce the link on file load again, and the link would never go away (without manually removing those range names). --- sc/source/ui/docshell/externalrefmgr.cxx | 48 +++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index fc12cf1a8681..59365c103763 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -74,6 +74,7 @@ using ::rtl::OUString; using ::std::vector; using ::std::find; using ::std::find_if; +using ::std::remove_if; using ::std::distance; using ::std::pair; using ::std::list; @@ -85,7 +86,7 @@ using namespace formula; namespace { -class TabNameSearchPredicate : public unary_function +class TabNameSearchPredicate : public unary_function { public: explicit TabNameSearchPredicate(const String& rSearchName) : @@ -201,6 +202,35 @@ private: ScDocument* mpDoc; }; +/** + * Predicate used to determine whether a named range contains an external + * reference to a particular document. + */ +class RangeNameWithExtRef : unary_function +{ + sal_uInt16 mnFileId; +public: + RangeNameWithExtRef(sal_uInt16 nFileId) : mnFileId(nFileId) {} + bool operator() (ScRangeData& rData) const + { + ScTokenArray* pArray = rData.GetCode(); + if (!pArray) + return false; + + pArray->Reset(); + ScToken* p = static_cast(pArray->GetNextReference()); + for (; p; p = static_cast(pArray->GetNextReference())) + { + if (!p->IsExternalRef()) + continue; + + if (p->GetIndex() == mnFileId) + return true; + } + return false; + } +}; + } // ============================================================================ @@ -2391,6 +2421,22 @@ void ScExternalRefManager::breakLink(sal_uInt16 nFileId) // the original container. RefCellSet aSet = itrRefs->second; for_each(aSet.begin(), aSet.end(), ConvertFormulaToStatic(mpDoc)); + + // Remove all named ranges that reference this document. + + // Global named ranges. + ScRangeName* pRanges = mpDoc->GetRangeName(); + if (pRanges) + remove_if(pRanges->begin(), pRanges->end(), RangeNameWithExtRef(nFileId)); + + // Sheet-local named ranges. + for (SCTAB i = 0, n = mpDoc->GetTableCount(); i < n; ++i) + { + pRanges = mpDoc->GetRangeName(i); + if (pRanges) + remove_if(pRanges->begin(), pRanges->end(), RangeNameWithExtRef(nFileId)); + } + maRefCells.erase(nFileId); } -- cgit v1.2.3 From 0ae3f088e40f9c2cb8a207db920b447555a9d14b Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 6 May 2011 01:12:37 -0400 Subject: Wrong approach. You can't use remove_if with set. std::remove_if is only for sequence containers, not for associative containers. Sure enough, using that caused crash on closing the document. This fixes it. --- sc/source/ui/docshell/externalrefmgr.cxx | 65 +++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index 59365c103763..d1cc63656cc9 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -203,34 +203,55 @@ private: }; /** - * Predicate used to determine whether a named range contains an external - * reference to a particular document. + * Check whether a named range contains an external reference to a + * particular document. */ -class RangeNameWithExtRef : unary_function +bool hasRefsToSrcDoc(ScRangeData& rData, sal_uInt16 nFileId) { - sal_uInt16 mnFileId; -public: - RangeNameWithExtRef(sal_uInt16 nFileId) : mnFileId(nFileId) {} - bool operator() (ScRangeData& rData) const + ScTokenArray* pArray = rData.GetCode(); + if (!pArray) + return false; + + pArray->Reset(); + ScToken* p = static_cast(pArray->GetNextReference()); + for (; p; p = static_cast(pArray->GetNextReference())) { - ScTokenArray* pArray = rData.GetCode(); - if (!pArray) - return false; + if (!p->IsExternalRef()) + continue; - pArray->Reset(); - ScToken* p = static_cast(pArray->GetNextReference()); - for (; p; p = static_cast(pArray->GetNextReference())) - { - if (!p->IsExternalRef()) - continue; + if (p->GetIndex() == nFileId) + return true; + } + return false; +} - if (p->GetIndex() == mnFileId) - return true; - } - return false; +class EraseRangeByIterator : unary_function +{ + ScRangeName& mrRanges; +public: + EraseRangeByIterator(ScRangeName& rRanges) : mrRanges(rRanges) {} + void operator() (const ScRangeName::iterator& itr) + { + mrRanges.erase(itr); } }; +/** + * Remove all named ranges that contain references to specified source + * document. + */ +void removeRangeNamesBySrcDoc(ScRangeName& rRanges, sal_uInt16 nFileId) +{ + ScRangeName::iterator itr = rRanges.begin(), itrEnd = rRanges.end(); + vector v; + for (; itr != itrEnd; ++itr) + { + if (hasRefsToSrcDoc(*itr, nFileId)) + v.push_back(itr); + } + for_each(v.begin(), v.end(), EraseRangeByIterator(rRanges)); +} + } // ============================================================================ @@ -2427,14 +2448,14 @@ void ScExternalRefManager::breakLink(sal_uInt16 nFileId) // Global named ranges. ScRangeName* pRanges = mpDoc->GetRangeName(); if (pRanges) - remove_if(pRanges->begin(), pRanges->end(), RangeNameWithExtRef(nFileId)); + removeRangeNamesBySrcDoc(*pRanges, nFileId); // Sheet-local named ranges. for (SCTAB i = 0, n = mpDoc->GetTableCount(); i < n; ++i) { pRanges = mpDoc->GetRangeName(i); if (pRanges) - remove_if(pRanges->begin(), pRanges->end(), RangeNameWithExtRef(nFileId)); + removeRangeNamesBySrcDoc(*pRanges, nFileId); } maRefCells.erase(nFileId); -- cgit v1.2.3 From a1749730513d3e6a1c96e7f527dd08a6743999d6 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 6 May 2011 01:50:02 -0400 Subject: Remove range names with external references regardless of cells. Sometimes range names may contain external references but no sheet cells reference that range names. Even then, breaking the link should remove those range names. --- sc/source/ui/docshell/externalrefmgr.cxx | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index d1cc63656cc9..1bfdc8b5b88f 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -2442,23 +2442,22 @@ void ScExternalRefManager::breakLink(sal_uInt16 nFileId) // the original container. RefCellSet aSet = itrRefs->second; for_each(aSet.begin(), aSet.end(), ConvertFormulaToStatic(mpDoc)); + maRefCells.erase(nFileId); + } + + // Remove all named ranges that reference this document. - // Remove all named ranges that reference this document. + // Global named ranges. + ScRangeName* pRanges = mpDoc->GetRangeName(); + if (pRanges) + removeRangeNamesBySrcDoc(*pRanges, nFileId); - // Global named ranges. - ScRangeName* pRanges = mpDoc->GetRangeName(); + // Sheet-local named ranges. + for (SCTAB i = 0, n = mpDoc->GetTableCount(); i < n; ++i) + { + pRanges = mpDoc->GetRangeName(i); if (pRanges) removeRangeNamesBySrcDoc(*pRanges, nFileId); - - // Sheet-local named ranges. - for (SCTAB i = 0, n = mpDoc->GetTableCount(); i < n; ++i) - { - pRanges = mpDoc->GetRangeName(i); - if (pRanges) - removeRangeNamesBySrcDoc(*pRanges, nFileId); - } - - maRefCells.erase(nFileId); } lcl_removeByFileId(nFileId, maDocShells); -- cgit v1.2.3 From 4d7ae8d1436e43b9262fe722f7ea7ad8a395ddb0 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 6 May 2011 10:35:53 +0300 Subject: Use MKDIRHIER to avoid "File exists" errors (which are ignored, but still) --- solenv/inc/rules.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solenv/inc/rules.mk b/solenv/inc/rules.mk index db97eddea355..0ff659c7ec1b 100644 --- a/solenv/inc/rules.mk +++ b/solenv/inc/rules.mk @@ -715,14 +715,14 @@ $(MISC)/%.sh : %.sh .IF "$(WITH_LANG)"!="" $(COMMONMISC)/$(TARGET)/%.ulf : %.ulf @echo "Making: " $(@:f) - $(COMMAND_ECHO)-$(MKDIR) $(@:d) + $(COMMAND_ECHO)-$(MKDIRHIER) $(@:d) $(COMMAND_ECHO)-$(RM) $@ $(COMMAND_ECHO)$(ULFEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@ $(COMMAND_ECHO)-$(RM) $@.$(INPATH) $(COMMONMISC)/$(TARGET)/%.xrb : %.xrb - $(COMMAND_ECHO)-$(MKDIR) $(@:d) + $(COMMAND_ECHO)-$(MKDIRHIER) $(@:d) $(COMMAND_ECHO)-$(RM) $@ $(COMMAND_ECHO)$(XMLEX) -t xrb -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@ -- cgit v1.2.3 -- cgit v1.2.3 From 4aafcf2557aa7199f5b63c432f98a9889e8aa752 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Fri, 6 May 2011 15:42:59 +0200 Subject: Removed --ccache-skip configure option Not much point in forcing that - people should upgrade their ccache to >=3.1 on Mac (change not affecting any other platform) --- configure.in | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/configure.in b/configure.in index 3646be8b9675..e941e98c35aa 100755 --- a/configure.in +++ b/configure.in @@ -403,15 +403,6 @@ AC_ARG_ENABLE(check-only, ], ,) -AC_ARG_ENABLE(ccache-skip, - AS_HELP_STRING([--enable-ccache-skip], - [Allow the use of --ccache-skip to escape compiler flags that would - otherwise prevent caching of the result (currently used on Mac only) - NOTE: requires patched version because of a bug in ccache (see issue - 104567 for details and patch) explicitly enable if your version of - ccache doesn't identify as version 2.4_OOo. (default=auto)]), -,enable_ccache_skip=auto) - AC_ARG_ENABLE(build-unowinreg, AS_HELP_STRING([--enable-build-unowinreg], [Do not use the prebuilt unowinreg.dll. Build it instead. The MinGW C++ @@ -2879,19 +2870,14 @@ fi AC_SUBST(HAVE_CXX0X) # =================================================================== -# use --ccache-skip? +# use ccache? # =================================================================== -dnl used to escape compiler options for ccache that otherwise prevent +dnl need to check for ccache version: otherwise prevents dnl caching of the results (like "-x objective-c++" for Mac) -AC_MSG_CHECKING([whether we are allowed and able to use --ccache-skip]) +AC_MSG_CHECKING([whether we are able to use --ccache-skip]) if test "$_os" != "Darwin" ; then AC_MSG_RESULT([only used on Mac currently, skipping]) -elif test "$enable_ccache_skip" = "no" ; then - AC_MSG_RESULT([no - diabled explicitly]) -elif test "$enable_ccache_skip" = "yes" ; then - AC_MSG_RESULT([yes - enabled explicitly, skipping checks]) - AC_SUBST([USE_CCACHE], [YES]) -elif test "$enable_ccache_skip" = "auto" ; then +else # checking for ccache presence/version AC_MSG_RESULT([probing...]) AC_PATH_PROG([CCACHE],[ccache],[not_found]) @@ -2924,8 +2910,6 @@ elif test "$enable_ccache_skip" = "auto" ; then AC_MSG_NOTICE([ccache version $CCACHE_VERSION not accepted. See description for --enable-ccache-skip]) fi fi -else - AC_MSG_ERROR([invalid option to --enable-ccache-skip. Valid values are "auto", "yes" and "no"]) fi dnl =================================================================== -- cgit v1.2.3 From 7c8d2e74df4a048b85eb4b56614613ca4e6b7910 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Fri, 6 May 2011 14:46:17 +0100 Subject: fix for fdo#36898 remove some extra _USE_UNO #ifdef(s) that should have been removed when the associated define _USE_UNO was removed --- basic/source/app/app.cxx | 4 +--- basic/source/runtime/iosys.cxx | 16 ---------------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx index 1febb2809bf4..558a01353fbd 100644 --- a/basic/source/app/app.cxx +++ b/basic/source/app/app.cxx @@ -243,10 +243,8 @@ int BasicApp::Main( ) try { -#ifdef _USE_UNO + // this line is not ( afaics ) necessary ( remove from master ) uno::Reference< XContentProviderManager > xUcb = InitializeUCB(); -#endif - { DirEntry aIniPath( Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") ) ); if ( !aIniPath.Exists() ) diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx index e46c51caee11..ac02051ba679 100644 --- a/basic/source/runtime/iosys.cxx +++ b/basic/source/runtime/iosys.cxx @@ -171,8 +171,6 @@ void SbiStream::MapError() } } -#ifdef _USE_UNO - // TODO: Code is copied from daemons2/source/uno/asciiEncoder.cxx ::rtl::OUString findUserInDescription( const ::rtl::OUString& aDescription ) @@ -205,7 +203,6 @@ void SbiStream::MapError() return user; } -#endif // Hack for #83750 @@ -213,7 +210,6 @@ sal_Bool runsInSetup( void ); sal_Bool needSecurityRestrictions( void ) { -#ifdef _USE_UNO static sal_Bool bNeedInit = sal_True; static sal_Bool bRetVal = sal_True; @@ -290,9 +286,6 @@ sal_Bool needSecurityRestrictions( void ) } return bRetVal; -#else - return sal_False; -#endif } // Returns sal_True if UNO is available, otherwise the old file @@ -300,7 +293,6 @@ sal_Bool needSecurityRestrictions( void ) // #89378 New semantic: Don't just ask for UNO but for UCB sal_Bool hasUno( void ) { -#ifdef _USE_UNO static sal_Bool bNeedInit = sal_True; static sal_Bool bRetVal = sal_True; @@ -326,9 +318,6 @@ sal_Bool hasUno( void ) } } return bRetVal; -#else - return sal_False; -#endif } @@ -421,7 +410,6 @@ void OslStream::SetSize( sal_uIntPtr nSize ) } -#ifdef _USE_UNO class UCBStream : public SvStream { @@ -585,8 +573,6 @@ void UCBStream::SetSize( sal_uIntPtr nSize ) SetError( ERRCODE_IO_GENERAL ); } -#endif - // Oeffnen eines Streams SbError SbiStream::Open ( short nCh, const ByteString& rName, short nStrmMode, short nFlags, short nL ) @@ -601,7 +587,6 @@ SbError SbiStream::Open String aStr( rName, gsl_getSystemTextEncoding() ); String aNameStr = getFullPath( aStr ); -#ifdef _USE_UNO if( hasUno() ) { Reference< XMultiServiceFactory > xSMgr = getProcessServiceFactory(); @@ -646,7 +631,6 @@ SbError SbiStream::Open } } -#endif if( !pStrm ) { pStrm = new OslStream( aNameStr, nStrmMode ); -- cgit v1.2.3 -- cgit v1.2.3 From c313d45a2e75e994b6a35d4d18b308c498967299 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Fri, 6 May 2011 18:13:35 +0200 Subject: Fix dbglevel=2 build --- vcl/unx/source/printer/ppdparser.cxx | 4 ++-- vcl/unx/source/printer/printerinfomanager.cxx | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/vcl/unx/source/printer/ppdparser.cxx b/vcl/unx/source/printer/ppdparser.cxx index 30d4598568d2..f51e4133fa13 100644 --- a/vcl/unx/source/printer/ppdparser.cxx +++ b/vcl/unx/source/printer/ppdparser.cxx @@ -510,7 +510,7 @@ void PPDParser::initPPDFiles() INetURLObject aDir( aExe ); aDir.removeSegment(); #ifdef DEBUG - fprintf( stderr, "scanning last chance dir: %s\n", OUStringToOString( aDir.GetMainURL( INetURLObject::NO_DECODE ), osl_getThreadTextEncoding() ).getStr() ); + fprintf( stderr, "scanning last chance dir: %s\n", rtl::OUStringToOString( aDir.GetMainURL( INetURLObject::NO_DECODE ), osl_getThreadTextEncoding() ).getStr() ); #endif scanPPDDir( aDir.GetMainURL( INetURLObject::NO_DECODE ) ); #ifdef DEBUG @@ -655,7 +655,7 @@ const PPDParser* PPDParser::getParser( const String& rFile ) if( ! aFile.Len() ) { #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "Could not get printer PPD file \"%s\" !\n", OUStringToOString( rFile, osl_getThreadTextEncoding() ).getStr() ); + fprintf( stderr, "Could not get printer PPD file \"%s\" !\n", rtl::OUStringToOString( rFile, osl_getThreadTextEncoding() ).getStr() ); #endif return NULL; } diff --git a/vcl/unx/source/printer/printerinfomanager.cxx b/vcl/unx/source/printer/printerinfomanager.cxx index e4634ab0c8b5..5334ac2cfcae 100644 --- a/vcl/unx/source/printer/printerinfomanager.cxx +++ b/vcl/unx/source/printer/printerinfomanager.cxx @@ -268,7 +268,7 @@ void PrinterInfoManager::initialize() if( aConfig.HasGroup( GLOBAL_DEFAULTS_GROUP ) ) { #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "found global defaults in %s\n", OUStringToOString( aFile.PathToFileName(), RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); + fprintf( stderr, "found global defaults in %s\n", rtl::OUStringToOString( aFile.PathToFileName(), RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); #endif aConfig.SetGroup( GLOBAL_DEFAULTS_GROUP ); @@ -817,8 +817,8 @@ bool PrinterInfoManager::writePrinterConfig() subst != it->second.m_aInfo.m_aFontSubstitutes.end(); ++subst ) { ByteString aKey( "SubstFont_" ); - aKey.Append( OUStringToOString( subst->first, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); - pConfig->WriteKey( aKey, OUStringToOString( subst->second, RTL_TEXTENCODING_ISO_8859_1 ) ); + aKey.Append( rtl::OUStringToOString( subst->first, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); + pConfig->WriteKey( aKey, rtl::OUStringToOString( subst->second, RTL_TEXTENCODING_ISO_8859_1 ) ); } } } @@ -873,7 +873,7 @@ bool PrinterInfoManager::addPrinter( const OUString& rPrinterName, const OUStrin bSuccess = true; #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "new printer %s, level = %d, pdfdevice = %d, colordevice = %d, depth = %d\n", - OUStringToOString( rPrinterName, osl_getThreadTextEncoding() ).getStr(), + rtl::OUStringToOString( rPrinterName, osl_getThreadTextEncoding() ).getStr(), m_aPrinters[rPrinterName].m_aInfo.m_nPSLevel, m_aPrinters[rPrinterName].m_aInfo.m_nPDFDevice, m_aPrinters[rPrinterName].m_aInfo.m_nColorDevice, @@ -1046,12 +1046,12 @@ void PrinterInfoManager::fillFontSubstitutions( PrinterInfo& rInfo ) const fprintf( stderr, "substitute %s %s %d %d\n" " -> %s %s %d %d\n", - OUStringToOString( it->m_aFamilyName, RTL_TEXTENCODING_ISO_8859_1 ).getStr(), + rtl::OUStringToOString( it->m_aFamilyName, RTL_TEXTENCODING_ISO_8859_1 ).getStr(), it->m_eItalic == italic::Upright ? "r" : it->m_eItalic == italic::Oblique ? "o" : it->m_eItalic == italic::Italic ? "i" : "u", it->m_eWeight, it->m_eWidth, - OUStringToOString( aInfo.m_aFamilyName, RTL_TEXTENCODING_ISO_8859_1 ).getStr(), + rtl::OUStringToOString( aInfo.m_aFamilyName, RTL_TEXTENCODING_ISO_8859_1 ).getStr(), aInfo.m_eItalic == italic::Upright ? "r" : aInfo.m_eItalic == italic::Oblique ? "o" : aInfo.m_eItalic == italic::Italic ? "i" : "u", aInfo.m_eWeight, aInfo.m_eWidth @@ -1117,7 +1117,7 @@ FILE* PrinterInfoManager::startSpool( const OUString& rPrintername, bool bQuickC const PrinterInfo& rPrinterInfo = getPrinterInfo (rPrintername); const rtl::OUString& rCommand = (bQuickCommand && rPrinterInfo.m_aQuickCommand.getLength() ) ? rPrinterInfo.m_aQuickCommand : rPrinterInfo.m_aCommand; - rtl::OString aShellCommand = OUStringToOString (rCommand, RTL_TEXTENCODING_ISO_8859_1); + rtl::OString aShellCommand = rtl::OUStringToOString (rCommand, RTL_TEXTENCODING_ISO_8859_1); aShellCommand += rtl::OString( " 2>/dev/null" ); return popen (aShellCommand.getStr(), "w"); @@ -1157,7 +1157,7 @@ void PrinterInfoManager::setDefaultPaper( PPDContext& rContext ) const { #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "not setting default paper, already set %s\n", - OUStringToOString( rContext.getValue( pPageSizeKey )->m_aOption, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); + rtl::OUStringToOString( rContext.getValue( pPageSizeKey )->m_aOption, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); #endif return; } @@ -1174,12 +1174,12 @@ void PrinterInfoManager::setDefaultPaper( PPDContext& rContext ) const if( pPaperVal ) { #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "setting default paper %s\n", OUStringToOString( pPaperVal->m_aOption, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); + fprintf( stderr, "setting default paper %s\n", rtl::OUStringToOString( pPaperVal->m_aOption, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); #endif rContext.setValue( pPageSizeKey, pPaperVal ); #if OSL_DEBUG_LEVEL > 1 pPaperVal = rContext.getValue( pPageSizeKey ); - fprintf( stderr, "-> got paper %s\n", OUStringToOString( pPaperVal->m_aOption, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); + fprintf( stderr, "-> got paper %s\n", rtl::OUStringToOString( pPaperVal->m_aOption, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); #endif } } -- cgit v1.2.3 From 73a6f18a50157cc1e67d248dac82b1509b20c24b Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Fri, 6 May 2011 19:32:42 +0200 Subject: allow to install LO-3.3 and LO-3.4 in parallel on Linux (fdo#36551) * rename the branding packages from libreoffice3 to libreoffice3.4 * move the default root dir from /opt/libreoffice to /opt/libreoffice3.4 --- instsetoo_native/util/openoffice.lst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/instsetoo_native/util/openoffice.lst b/instsetoo_native/util/openoffice.lst index 5124ddebdca9..785b203c448d 100644 --- a/instsetoo_native/util/openoffice.lst +++ b/instsetoo_native/util/openoffice.lst @@ -9,7 +9,7 @@ Globals UREPACKAGEVERSION 3.4.0 URELAYERVERSION 1 BASISROOTNAME LibreOffice - UNIXBASISROOTNAME libreoffice + UNIXBASISROOTNAME libreoffice3.4 SERVICETAG_PRODUCTNAME LibreOffice 3.4 SERVICETAG_PRODUCTVERSION 3.4 SERVICETAG_PARENTNAME LibreOffice 3.4 @@ -60,7 +60,7 @@ LibreOffice SHORT_PRODUCTEXTENSION beta4 POSTVERSIONEXTENSION POSTVERSIONEXTENSIONUNIX - BRANDPACKAGEVERSION 3 + BRANDPACKAGEVERSION 3.4 USERDIRPRODUCTVERSION 3 ABOUTBOXPRODUCTVERSION 3.4.0 BASEPRODUCTVERSION 3.4 @@ -128,7 +128,7 @@ LibreOffice_wJRE SHORT_PRODUCTEXTENSION beta4 POSTVERSIONEXTENSION POSTVERSIONEXTENSIONUNIX - BRANDPACKAGEVERSION 3 + BRANDPACKAGEVERSION 3.4 USERDIRPRODUCTVERSION 3 ABOUTBOXPRODUCTVERSION 3.4.0 BASEPRODUCTVERSION 3.4 @@ -194,7 +194,7 @@ LibreOffice_Dev UNIXBASISROOTNAME lo-dev POSTVERSIONEXTENSION POSTVERSIONEXTENSIONUNIX - BRANDPACKAGEVERSION 3 + BRANDPACKAGEVERSION 3.4 USERDIRPRODUCTVERSION 3 ABOUTBOXPRODUCTVERSION 3.4.0 BASEPRODUCTVERSION 3.4 @@ -264,7 +264,7 @@ URE PACKAGEVERSION 3.4 PACKAGEREVISION 1 PRODUCTEXTENSION - BRANDPACKAGEVERSION 3 + BRANDPACKAGEVERSION 3.4 LONG_PRODUCTEXTENSION SHORT_PRODUCTEXTENSION beta4 LICENSENAME LGPL @@ -308,7 +308,7 @@ LibreOffice_SDK SHORT_PRODUCTEXTENSION beta4 POSTVERSIONEXTENSION SDK POSTVERSIONEXTENSIONUNIX sdk - BRANDPACKAGEVERSION 3 + BRANDPACKAGEVERSION 3.4 PACKAGEVERSION 3.4.0 PACKAGEREVISION {milestone} PACK_INSTALLED 1 @@ -356,7 +356,7 @@ LibreOffice_Dev_SDK UNIXBASISROOTNAME lo-dev POSTVERSIONEXTENSION SDK POSTVERSIONEXTENSIONUNIX sdk - BRANDPACKAGEVERSION 3 + BRANDPACKAGEVERSION 3.4 PACKAGEVERSION 3.4.0 PACKAGEREVISION {milestone} BASISPACKAGEPREFIX libobasis-dev @@ -407,7 +407,7 @@ OxygenOffice SHORT_PRODUCTEXTENSION beta4 POSTVERSIONEXTENSION POSTVERSIONEXTENSIONUNIX - BRANDPACKAGEVERSION 3 + BRANDPACKAGEVERSION 3.4 USERDIRPRODUCTVERSION 3 ABOUTBOXPRODUCTVERSION 3.4.0 BASEPRODUCTVERSION 3.4 @@ -476,7 +476,7 @@ OxygenOffice_wJRE SHORT_PRODUCTEXTENSION beta4 POSTVERSIONEXTENSION POSTVERSIONEXTENSIONUNIX - BRANDPACKAGEVERSION 3 + BRANDPACKAGEVERSION 3.4 USERDIRPRODUCTVERSION 3 ABOUTBOXPRODUCTVERSION 3.4.0 BASEPRODUCTVERSION 3.3 -- cgit v1.2.3 From bc9fc1d2393a6e6dbb6249f0ffe83a2f077b7636 Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Fri, 6 May 2011 19:36:41 +0200 Subject: fix desktop integration for the versioned root dir (fdo#36551) we want to install LO-3.3 and LO-3.4 in parallel, so we started to use /opt/libreoffice3.4 instead of /opt/libreoffice --- sysui/desktop/freedesktop/freedesktop-menus.spec | 4 ++-- sysui/desktop/mandriva/mandriva-menus.spec | 6 +++--- sysui/desktop/productversion.mk | 4 ++-- sysui/desktop/redhat/redhat-menus.spec | 7 ++++--- sysui/desktop/share/create_tree.sh | 8 ++++---- sysui/desktop/share/makefile.mk | 1 + sysui/desktop/suse/suse-menus.spec | 6 +++--- sysui/desktop/tg_rpm.mk | 1 + 8 files changed, 20 insertions(+), 17 deletions(-) diff --git a/sysui/desktop/freedesktop/freedesktop-menus.spec b/sysui/desktop/freedesktop/freedesktop-menus.spec index 8cec36901e9f..9f4bfe0bee61 100755 --- a/sysui/desktop/freedesktop/freedesktop-menus.spec +++ b/sysui/desktop/freedesktop/freedesktop-menus.spec @@ -326,9 +326,9 @@ done # glibc breaks rpm unless rpm is build with internal glob-matching (issue 49374) # https://bugzilla.redhat.com/beta/show_bug.cgi?id=134362 %defattr(-, root, root) -%if %unixfilename != libreoffice +%if "%unixfilename" != "libreoffice%productversion" # compat symlinks -%attr(0755, root, root) /opt/%unixfilename +%attr(0755,root,root) /opt/%unixfilename %endif %attr(0755, root, root) /usr/bin/* /usr/share/applications/%unixfilename-base.desktop diff --git a/sysui/desktop/mandriva/mandriva-menus.spec b/sysui/desktop/mandriva/mandriva-menus.spec index a2c52de584ff..47f64ed226cb 100755 --- a/sysui/desktop/mandriva/mandriva-menus.spec +++ b/sysui/desktop/mandriva/mandriva-menus.spec @@ -317,11 +317,11 @@ fi %files -%if %unixfilename != libreoffice +%if "%unixfilename" != "libreoffice%productversion" # compat symlinks %attr(0755,root,root) /opt/%unixfilename -%attr(0755,root,root) /usr/bin/libreoffice -%attr(0755,root,root) /usr/bin/libreoffice-printeradmin +%attr(0755,root,root) /usr/bin/libreoffice%productversion +%attr(0755,root,root) /usr/bin/libreoffice%productversion-printeradmin %endif %attr(0755,root,root) %verify(not size md5) /usr/bin/%unixfilename %attr(0755,root,root) /usr/bin/%unixfilename-printeradmin diff --git a/sysui/desktop/productversion.mk b/sysui/desktop/productversion.mk index 6f41333370dc..8d1f93cd69c8 100755 --- a/sysui/desktop/productversion.mk +++ b/sysui/desktop/productversion.mk @@ -62,14 +62,14 @@ PRODUCTNAME.libreoffice = LibreOffice PRODUCTVERSION.libreoffice = $(PRODUCTVERSION) PRODUCTVERSIONSHORT.libreoffice = $(PRODUCTVERSIONSHORT) PKGVERSION.libreoffice = $(PKGVERSION) -UNIXFILENAME.libreoffice = $(PRODUCTNAME.libreoffice:l) +UNIXFILENAME.libreoffice = $(PRODUCTNAME.libreoffice:l)$(PRODUCTVERSION.libreoffice) ICONPREFIX.libreoffice = $(UNIXFILENAME.libreoffice:s/.//g) PRODUCTNAME.broffice = BrOffice PRODUCTVERSION.broffice = $(PRODUCTVERSION) PRODUCTVERSIONSHORT.broffice = $(PRODUCTVERSIONSHORT) PKGVERSION.broffice = $(PKGVERSION) -UNIXFILENAME.broffice = $(PRODUCTNAME.broffice:l) +UNIXFILENAME.broffice = $(PRODUCTNAME.broffice:l)$(PRODUCTVERSION.broffice) ICONPREFIX.broffice = $(UNIXFILENAME.broffice:s/.//g) diff --git a/sysui/desktop/redhat/redhat-menus.spec b/sysui/desktop/redhat/redhat-menus.spec index 865703b0797a..f7b8588907c3 100755 --- a/sysui/desktop/redhat/redhat-menus.spec +++ b/sysui/desktop/redhat/redhat-menus.spec @@ -274,13 +274,14 @@ for theme in gnome hicolor locolor; do true fi done +echo unixfilename=%unixfilename %files -%if %unixfilename != libreoffice +%if "%unixfilename" != "libreoffice%productversion" # compat symlinks %attr(0755,root,root) /opt/%unixfilename -%attr(0755,root,root) /usr/bin/libreoffice -%attr(0755,root,root) /usr/bin/libreoffice-printeradmin +%attr(0755,root,root) /usr/bin/libreoffice%productversion +%attr(0755,root,root) /usr/bin/libreoffice%productversion-printeradmin %endif %attr(0755,root,root) %verify(not size md5) /usr/bin/%unixfilename %attr(0755,root,root) /usr/bin/%unixfilename-printeradmin diff --git a/sysui/desktop/share/create_tree.sh b/sysui/desktop/share/create_tree.sh index 2fe78c36a4ec..68b458c4b223 100755 --- a/sysui/desktop/share/create_tree.sh +++ b/sysui/desktop/share/create_tree.sh @@ -101,12 +101,12 @@ ln -sf ${office_root}/program/soffice ${DESTDIR}/usr/bin/${PREFIX} cp printeradmin.sh ${DESTDIR}/usr/bin/${PREFIX}-printeradmin chmod 0755 ${DESTDIR}/usr/bin/${PREFIX} ${DESTDIR}/usr/bin/${PREFIX}-printeradmin -if test "${PREFIX}" != libreoffice ; then +if test "${PREFIX}" != libreoffice${PRODUCTVERSION} ; then # compat symlinks mkdir -p ${DESTDIR}${office_prefix} - ln -sf libreoffice ${DESTDIR}${office_root} - ln -sf /usr/bin/${PREFIX} ${DESTDIR}/usr/bin/libreoffice - ln -sf /usr/bin/${PREFIX}-printeradmin ${DESTDIR}/usr/bin/libreoffice-printeradmin + ln -sf libreoffice${PRODUCTVERSION} ${DESTDIR}${office_root} + ln -sf /usr/bin/${PREFIX} ${DESTDIR}/usr/bin/libreoffice${PRODUCTVERSION} + ln -sf /usr/bin/${PREFIX}-printeradmin ${DESTDIR}/usr/bin/libreoffice${PRODUCTVERSION}-printeradmin fi mkdir -p ${DESTDIR}/usr/share/mime/packages diff --git a/sysui/desktop/share/makefile.mk b/sysui/desktop/share/makefile.mk index 45a1b11c85f3..bc1ef5082c89 100755 --- a/sysui/desktop/share/makefile.mk +++ b/sysui/desktop/share/makefile.mk @@ -224,6 +224,7 @@ $(COMMONMISC)$/{$(PRODUCTLIST)}$/create_tree.sh : $$(@:f) @echo "PREFIX=$(UNIXFILENAME.$(@:d:d:f))" >> $@.$(INPATH) @echo "ICON_PREFIX=$(ICONPREFIX.$(@:d:d:f))" >> $@.$(INPATH) @echo "ICON_SOURCE_DIR=../../../desktop/icons" >> $@.$(INPATH) + @echo "PRODUCTVERSION=$(PRODUCTVERSION.$(@:d:d:f))" >> $@.$(INPATH) @cat $< >> $@.$(INPATH) @chmod 774 $@.$(INPATH) @mv -f $@.$(INPATH) $@ diff --git a/sysui/desktop/suse/suse-menus.spec b/sysui/desktop/suse/suse-menus.spec index 74eb0a5fcc9c..46b24c54b293 100755 --- a/sysui/desktop/suse/suse-menus.spec +++ b/sysui/desktop/suse/suse-menus.spec @@ -288,11 +288,11 @@ for themedir in /opt/gnome/share/icons/gnome /opt/gnome/share/icons/hicolor /opt done %files -%if %unixfilename != libreoffice +%if "%unixfilename" != "libreoffice%productversion" # compat symlinks %attr(0755,root,root) /opt/%unixfilename -%attr(0755,root,root) /usr/bin/libreoffice -%attr(0755,root,root) /usr/bin/libreoffice-printeradmin +%attr(0755,root,root) /usr/bin/libreoffice%productversion +%attr(0755,root,root) /usr/bin/libreoffice%productversion-printeradmin %endif %attr(0755,root,root) %verify(not size md5) /usr/bin/%unixfilename %attr(0755,root,root) /usr/bin/%unixfilename-printeradmin diff --git a/sysui/desktop/tg_rpm.mk b/sysui/desktop/tg_rpm.mk index 6fab6e748a99..0ff9af4dca3d 100755 --- a/sysui/desktop/tg_rpm.mk +++ b/sysui/desktop/tg_rpm.mk @@ -38,6 +38,7 @@ $(RPMFLAGFILES) : $(SPECFILE) --define "productname $(PRODUCTNAME.$(@:b:s/-/ /:1))" \ --define "pkgprefix $(@:b:s/-/ /:1)$(PRODUCTVERSION.$(@:b:s/-/ /:1))" \ --define "unixfilename $(UNIXFILENAME.$(@:b:s/-/ /:1))" \ + --define "productversion $(PRODUCTVERSION.$(@:b:s/-/ /:1))" \ --define "iconprefix $(ICONPREFIX.$(@:b:s/-/ /:1))" \ --define "version $(PKGVERSION.$(@:b:s/-/ /:1))" \ --define "release $(PKGREV)" \ -- cgit v1.2.3 From 65aea4659a3607325085f1fba6adac913f8909d9 Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Fri, 6 May 2011 20:34:43 +0200 Subject: do not conflict with /usr/share/mime/packages/libreoffice.xml (fdo#36551) --- sysui/desktop/share/create_tree.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sysui/desktop/share/create_tree.sh b/sysui/desktop/share/create_tree.sh index 68b458c4b223..264f1e426e71 100755 --- a/sysui/desktop/share/create_tree.sh +++ b/sysui/desktop/share/create_tree.sh @@ -110,8 +110,8 @@ if test "${PREFIX}" != libreoffice${PRODUCTVERSION} ; then fi mkdir -p ${DESTDIR}/usr/share/mime/packages -cp openoffice.org.xml ${DESTDIR}/usr/share/mime/packages/libreoffice.xml -chmod 0644 ${DESTDIR}/usr/share/mime/packages/libreoffice.xml +cp openoffice.org.xml ${DESTDIR}/usr/share/mime/packages/libreoffice${PRODUCTVERSION}.xml +chmod 0644 ${DESTDIR}/usr/share/mime/packages/libreoffice${PRODUCTVERSION}.xml mkdir -p ${DESTDIR}/usr/share/applications for i in `cat launcherlist`; do -- cgit v1.2.3 From 69a290dd646eb7147a7ffbf52dd02faa21f09a93 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 6 May 2011 15:35:19 -0400 Subject: Explicitly specify less function object for map, to get it to build with MSVC. --- sc/inc/dpobject.hxx | 7 ++++++- sc/qa/unit/ucalc.cxx | 2 +- sc/source/core/data/dpobject.cxx | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index 30ca8406d11e..d71040906443 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -297,6 +297,11 @@ public: ::rtl::OUString maDBName; ::rtl::OUString maCommand; DBType(sal_Int32 nSdbType, const ::rtl::OUString& rDBName, const ::rtl::OUString& rCommand); + + struct less : public ::std::binary_function + { + bool operator() (const DBType& left, const DBType& right) const; + }; }; /** @@ -304,7 +309,7 @@ public: */ class DBCaches { - typedef ::boost::ptr_map CachesType; + typedef ::boost::ptr_map CachesType; CachesType maCaches; ScDocument* mpDoc; public: diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 8c3c37ecc726..e7ab145c4aaa 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -798,7 +798,7 @@ ScDPObject* createDPFromRange( { OUString aDimName(aFields[i].pName, strlen(aFields[i].pName), RTL_TEXTENCODING_UTF8); ScDPSaveDimension* pDim = aSaveData.GetDimensionByName(aDimName); - pDim->SetOrientation(aFields[i].eOrient); + pDim->SetOrientation(static_cast(aFields[i].eOrient)); pDim->SetUsedHierarchy(0); pDim->SetShowEmpty(true); diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 9589fe838f7a..7f5abef802ea 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -2445,6 +2445,11 @@ void ScDPCollection::NameCaches::removeCache(const OUString& rName) ScDPCollection::DBType::DBType(sal_Int32 nSdbType, const OUString& rDBName, const OUString& rCommand) : mnSdbType(nSdbType), maDBName(rDBName), maCommand(rCommand) {} +bool ScDPCollection::DBType::less::operator() (const DBType& left, const DBType& right) const +{ + return left < right; +} + ScDPCollection::DBCaches::DBCaches(ScDocument* pDoc) : mpDoc(pDoc) {} const ScDPCache* ScDPCollection::DBCaches::getCache(sal_Int32 nSdbType, const OUString& rDBName, const OUString& rCommand) -- cgit v1.2.3 From cf9994a4de40b1770f4b321da97d929fa0b0ebc2 Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Fri, 6 May 2011 21:55:24 +0200 Subject: do not conflict with GNOME MIME icons (fdo#36551) create the symlinks in post install; it is not perfect because they are not remove in postun but is it worth hacking? --- sysui/desktop/freedesktop/freedesktop-menus.spec | 49 ++++++++++++++++++++++- sysui/desktop/redhat/redhat-menus.spec | 50 ++++++++++++++++++++++- sysui/desktop/share/create_tree.sh | 49 ----------------------- sysui/desktop/suse/suse-menus.spec | 51 +++++++++++++++++++++++- 4 files changed, 146 insertions(+), 53 deletions(-) diff --git a/sysui/desktop/freedesktop/freedesktop-menus.spec b/sysui/desktop/freedesktop/freedesktop-menus.spec index 9f4bfe0bee61..1cb1554a6a5f 100755 --- a/sysui/desktop/freedesktop/freedesktop-menus.spec +++ b/sysui/desktop/freedesktop/freedesktop-menus.spec @@ -40,7 +40,6 @@ umask 0000 export DESTDIR=$RPM_BUILD_ROOT export KDEMAINDIR=/usr export GNOMEDIR=/usr -export GNOME_MIME_THEME=hicolor ./create_tree.sh @@ -105,6 +104,54 @@ if [ "$1" = "1" ] ; then # first install fi fi +# add symlinks so that nautilus can identify the mime-icons +# not strictly freedesktop-stuff but there is no common naming scheme yet. +# One proposal is "mime-application:vnd.oasis.opendocument.spreadsheet.png" +# for e.g. application/vnd.oasis.opendocument.spreadsheet +link_target_root="/opt/gnome/share/icons/hicolor" + +if [ ! -d "${link_target_root}" ] +then + link_target_root="/opt/gnome/share/icons/gnome" +fi + +for subdir in `cd ${link_target_root}; ls -d *` +do + link_dir="/opt/gnome/share/icons/hicolor/$subdir/mimetypes" + link_target_dir="../../../gnome/$subdir/mimetypes" + + test -d ${link_dir}/${link_target_dir} || continue; + + if [ ! -d "${link_dir}" ] + then + mkdir -p "${link_dir}" + fi + + icon=%iconprefix-drawing.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.png + icon=%iconprefix-drawing-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.template.png + icon=%iconprefix-formula.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.math.png + icon=%iconprefix-master-document.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.global.png + icon=%iconprefix-oasis-database.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.base.png + icon=%iconprefix-oasis-database.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.database.png + icon=%iconprefix-oasis-drawing.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics.png + icon=%iconprefix-oasis-drawing-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics-template.png + icon=%iconprefix-oasis-formula.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.formula.png + icon=%iconprefix-oasis-master-document.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-master.png + icon=%iconprefix-oasis-presentation.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation.png + icon=%iconprefix-oasis-presentation-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation-template.png + icon=%iconprefix-oasis-spreadsheet.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet.png + icon=%iconprefix-oasis-spreadsheet-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet-template.png + icon=%iconprefix-oasis-text.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text.png + icon=%iconprefix-oasis-text-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-template.png + icon=%iconprefix-oasis-web-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-web.png + icon=%iconprefix-presentation.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.png + icon=%iconprefix-presentation-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.template.png + icon=%iconprefix-spreadsheet.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.png + icon=%iconprefix-spreadsheet-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.template.png + icon=%iconprefix-text.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.png + icon=%iconprefix-text-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.template.png + icon=%iconprefix-extension.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.openofficeorg.extension.png +done #run always for theme in gnome hicolor locolor; do diff --git a/sysui/desktop/redhat/redhat-menus.spec b/sysui/desktop/redhat/redhat-menus.spec index f7b8588907c3..8ecb446d2774 100755 --- a/sysui/desktop/redhat/redhat-menus.spec +++ b/sysui/desktop/redhat/redhat-menus.spec @@ -28,7 +28,6 @@ mkdir -p $RPM_BUILD_ROOT export DESTDIR=$RPM_BUILD_ROOT export KDEMAINDIR=/usr export GNOMEDIR=/usr -export GNOME_MIME_THEME=hicolor ./create_tree.sh @@ -65,6 +64,55 @@ if [ -x /usr/bin/update-mime-database ]; then update-mime-database /usr/share/mime fi +# add symlinks so that nautilus can identify the mime-icons +# not strictly freedesktop-stuff but there is no common naming scheme yet. +# One proposal is "mime-application:vnd.oasis.opendocument.spreadsheet.png" +# for e.g. application/vnd.oasis.opendocument.spreadsheet +link_target_root="/opt/gnome/share/icons/hicolor" + +if [ ! -d "${link_target_root}" ] +then + link_target_root="/opt/gnome/share/icons/gnome" +fi + +for subdir in `cd ${link_target_root}; ls -d *` +do + link_dir="/opt/gnome/share/icons/hicolor/$subdir/mimetypes" + link_target_dir="../../../gnome/$subdir/mimetypes" + + test -d ${link_dir}/${link_target_dir} || continue; + + if [ ! -d "${link_dir}" ] + then + mkdir -p "${link_dir}" + fi + + icon=%iconprefix-drawing.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.png + icon=%iconprefix-drawing-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.template.png + icon=%iconprefix-formula.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.math.png + icon=%iconprefix-master-document.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.global.png + icon=%iconprefix-oasis-database.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.base.png + icon=%iconprefix-oasis-database.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.database.png + icon=%iconprefix-oasis-drawing.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics.png + icon=%iconprefix-oasis-drawing-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics-template.png + icon=%iconprefix-oasis-formula.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.formula.png + icon=%iconprefix-oasis-master-document.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-master.png + icon=%iconprefix-oasis-presentation.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation.png + icon=%iconprefix-oasis-presentation-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation-template.png + icon=%iconprefix-oasis-spreadsheet.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet.png + icon=%iconprefix-oasis-spreadsheet-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet-template.png + icon=%iconprefix-oasis-text.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text.png + icon=%iconprefix-oasis-text-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-template.png + icon=%iconprefix-oasis-web-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-web.png + icon=%iconprefix-presentation.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.png + icon=%iconprefix-presentation-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.template.png + icon=%iconprefix-spreadsheet.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.png + icon=%iconprefix-spreadsheet-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.template.png + icon=%iconprefix-text.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.png + icon=%iconprefix-text-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.template.png + icon=%iconprefix-extension.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.openofficeorg.extension.png +done + # run only on first install, since postun is run when updating # post would be run before the old files are removed if [ "$1" = "1" ] ; then # first install diff --git a/sysui/desktop/share/create_tree.sh b/sysui/desktop/share/create_tree.sh index 264f1e426e71..d0c4e7621d9d 100755 --- a/sysui/desktop/share/create_tree.sh +++ b/sysui/desktop/share/create_tree.sh @@ -39,55 +39,6 @@ then mkdir -p ${DESTDIR}/${GNOMEDIR}/share/application-registry cp openoffice.applications ${DESTDIR}/${GNOMEDIR}/share/application-registry/${PREFIX}.applications chmod 0644 ${DESTDIR}/${GNOMEDIR}/share/application-registry/${PREFIX}.* - - if [ "${GNOME_MIME_THEME}" ] - then - echo "Creating legacy mimetype symlinks for GNOME .." - # add symlinks so that nautilus can identify the mime-icons - # not strictly freedesktop-stuff but there is no common naming scheme yet. - # One proposal is "mime-application:vnd.oasis.opendocument.spreadsheet.png" - # for e.g. application/vnd.oasis.opendocument.spreadsheet - link_target_root="${DESTDIR}/${GNOMEDIR}/share/icons/${GNOME_MIME_THEME}" - if [ ! -d "${link_target_root}" ] - then - link_target_root="${DESTDIR}/${GNOMEDIR}/share/icons/gnome" - fi - - for subdir in `cd ${link_target_root}; ls -d *` - do - link_target_dir="" - link_dir="${DESTDIR}/${GNOMEDIR}/share/icons/${GNOME_MIME_THEME}/$subdir/mimetypes" - if [ ! -d "${link_dir}" ] - then - mkdir -p "${link_dir}" - link_target_dir="../../../gnome/$subdir/mimetypes/" - fi - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}drawing.png ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}drawing-template.png ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.template.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}formula.png ${link_dir}/gnome-mime-application-vnd.sun.xml.math.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}master-document.png ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.global.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-database.png ${link_dir}/gnome-mime-application-vnd.sun.xml.base.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-database.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.database.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-drawing.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-drawing-template.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics-template.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-formula.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.formula.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-master-document.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-master.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-presentation.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-presentation-template.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation-template.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-spreadsheet.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-spreadsheet-template.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet-template.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-text.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-text-template.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-template.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-web-template.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-web.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}presentation.png ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}presentation-template.png ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.template.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}spreadsheet.png ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}spreadsheet-template.png ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.template.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}text.png ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}text-template.png ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.template.png - ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}extension.png ${link_dir}/gnome-mime-application-vnd.openofficeorg.extension.png - done - fi fi mkdir -p ${DESTDIR}/usr/bin diff --git a/sysui/desktop/suse/suse-menus.spec b/sysui/desktop/suse/suse-menus.spec index 46b24c54b293..9ea2d332cb07 100755 --- a/sysui/desktop/suse/suse-menus.spec +++ b/sysui/desktop/suse/suse-menus.spec @@ -33,7 +33,6 @@ mkdir -p $RPM_BUILD_ROOT export DESTDIR=$RPM_BUILD_ROOT export KDEMAINDIR=/opt/kde3 export GNOMEDIR=/opt/gnome -export GNOME_MIME_THEME=hicolor ./create_tree.sh @@ -74,6 +73,55 @@ if [ -x /opt/gnome/bin/update-desktop-database ]; then /opt/gnome/bin/update-desktop-database fi +# add symlinks so that nautilus can identify the mime-icons +# not strictly freedesktop-stuff but there is no common naming scheme yet. +# One proposal is "mime-application:vnd.oasis.opendocument.spreadsheet.png" +# for e.g. application/vnd.oasis.opendocument.spreadsheet +link_target_root="/opt/gnome/share/icons/hicolor" + +if [ ! -d "${link_target_root}" ] +then + link_target_root="/opt/gnome/share/icons/gnome" +fi + +for subdir in `cd ${link_target_root}; ls -d *` +do + link_dir="/opt/gnome/share/icons/hicolor/$subdir/mimetypes" + link_target_dir="../../../gnome/$subdir/mimetypes" + + test -d ${link_dir}/${link_target_dir} || continue; + + if [ ! -d "${link_dir}" ] + then + mkdir -p "${link_dir}" + fi + + icon=%iconprefix-drawing.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.png + icon=%iconprefix-drawing-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.template.png + icon=%iconprefix-formula.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.math.png + icon=%iconprefix-master-document.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.global.png + icon=%iconprefix-oasis-database.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.base.png + icon=%iconprefix-oasis-database.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.database.png + icon=%iconprefix-oasis-drawing.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics.png + icon=%iconprefix-oasis-drawing-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics-template.png + icon=%iconprefix-oasis-formula.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.formula.png + icon=%iconprefix-oasis-master-document.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-master.png + icon=%iconprefix-oasis-presentation.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation.png + icon=%iconprefix-oasis-presentation-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation-template.png + icon=%iconprefix-oasis-spreadsheet.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet.png + icon=%iconprefix-oasis-spreadsheet-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet-template.png + icon=%iconprefix-oasis-text.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text.png + icon=%iconprefix-oasis-text-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-template.png + icon=%iconprefix-oasis-web-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-web.png + icon=%iconprefix-presentation.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.png + icon=%iconprefix-presentation-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.template.png + icon=%iconprefix-spreadsheet.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.png + icon=%iconprefix-spreadsheet-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.template.png + icon=%iconprefix-text.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.png + icon=%iconprefix-text-template.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.template.png + icon=%iconprefix-extension.png; test -f ${link_dir}/${link_target_dir}/$icon && ln -sf ${link_target_dir}/${icon} ${link_dir}/gnome-mime-application-vnd.openofficeorg.extension.png +done + # run only on first install, since postun is run when updating # post would be run before the old files are removed if [ "$1" = "1" ] ; then # first install @@ -312,7 +360,6 @@ done /opt/kde3/share/mimelnk/application/*.desktop /opt/gnome/share/icons/gnome/*/apps/*png /opt/gnome/share/icons/gnome/*/mimetypes/*png -/opt/gnome/share/icons/hicolor/*/mimetypes/*png /opt/kde3/share/icons/hicolor/*/apps/*png /opt/kde3/share/icons/hicolor/*/mimetypes/*png /opt/kde3/share/icons/locolor/*/apps/*png -- cgit v1.2.3 From 4d1306fcd126309b9d5b9ee745922d00ff1f172e Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Sat, 7 May 2011 01:10:22 +0200 Subject: Remove reference to binned config option. --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index e941e98c35aa..522b705e8ec0 100755 --- a/configure.in +++ b/configure.in @@ -2907,7 +2907,7 @@ else AC_LANG_POP([C++]) else AC_MSG_RESULT([no]) - AC_MSG_NOTICE([ccache version $CCACHE_VERSION not accepted. See description for --enable-ccache-skip]) + AC_MSG_NOTICE([ccache version $CCACHE_VERSION not accepted. ccache will not be used.]) fi fi fi -- cgit v1.2.3 From 11208eaa2fa89467e795a2f4dc6f17247caaa4aa Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 6 May 2011 22:34:11 -0400 Subject: fdo#36789: Set all dynamic controls invisible upon instantiation. Some of the dialog code depends on the controls being hidden unless explicitly set visible. Unfortunately that's not really guaranteed so we need to make that logic explicit. --- chart2/source/controller/dialogs/tp_Scale.cxx | 45 +++++++++++++++++++++++++++ chart2/source/controller/dialogs/tp_Scale.hxx | 2 ++ 2 files changed, 47 insertions(+) diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx b/chart2/source/controller/dialogs/tp_Scale.cxx index 0eb9ae7bf047..9e77ad94c35d 100644 --- a/chart2/source/controller/dialogs/tp_Scale.cxx +++ b/chart2/source/controller/dialogs/tp_Scale.cxx @@ -183,6 +183,8 @@ ScaleTabPage::ScaleTabPage(Window* pWindow,const SfxItemSet& rInAttrs) : aFmtFldMax.SetModifyHdl(LINK(this, ScaleTabPage, FmtFieldModifiedHdl)); aFmtFldStepMain.SetModifyHdl(LINK(this, ScaleTabPage, FmtFieldModifiedHdl)); aFmtFldOrigin.SetModifyHdl(LINK(this, ScaleTabPage, FmtFieldModifiedHdl)); + + HideAllControls(); } IMPL_LINK( ScaleTabPage, FmtFieldModifiedHdl, FormattedField*, pFmtFied ) @@ -784,6 +786,49 @@ bool ScaleTabPage::ShowWarning( sal_uInt16 nResIdMessage, Control* pControl /* = return true; } +void ScaleTabPage::HideAllControls() +{ + // We need to set these controls invisible when the class is instantiated + // since some code in EnableControls() depends on that logic. The real + // visibility of these controls depend on axis data type, and are + // set in EnableControls(). + + m_aTxt_AxisType.Hide(); + m_aLB_AxisType.Hide(); + + aCbxLogarithm.Hide(); + aTxtMin.Hide(); + aFmtFldMin.Hide(); + aCbxAutoMin.Hide(); + aTxtMax.Hide(); + aFmtFldMax.Hide(); + aCbxAutoMax.Hide(); + aTxtMain.Hide(); + aFmtFldStepMain.Hide(); + aCbxAutoStepMain.Hide(); + aTxtHelp.Hide(); + aTxtHelpCount.Hide(); + aMtStepHelp.Hide(); + aCbxAutoStepHelp.Hide(); + + aTxtOrigin.Hide(); + aFmtFldOrigin.Hide(); + aCbxAutoOrigin.Hide(); + + aTxtHelpCount.Hide(); + aTxtHelp.Hide(); + + m_aTxt_TimeResolution.Hide(); + m_aLB_TimeResolution.Hide(); + m_aCbx_AutoTimeResolution.Hide(); + + aFmtFldStepMain.Hide(); + m_aMt_MainDateStep.Hide(); + + m_aLB_MainTimeUnit.Hide(); + m_aLB_HelpTimeUnit.Hide(); +} + //............................................................................. } //namespace chart //............................................................................. diff --git a/chart2/source/controller/dialogs/tp_Scale.hxx b/chart2/source/controller/dialogs/tp_Scale.hxx index f062ed438383..0a56b4f7a0bd 100644 --- a/chart2/source/controller/dialogs/tp_Scale.hxx +++ b/chart2/source/controller/dialogs/tp_Scale.hxx @@ -138,6 +138,8 @@ private: @return false, if nResIdMessage was 0, true otherwise */ bool ShowWarning( sal_uInt16 nResIdMessage, Control* pControl = NULL ); + + void HideAllControls(); }; //............................................................................. -- cgit v1.2.3 From 18f45f7735f4a8922583e60dbe73e6e08a5ebaa4 Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Sat, 7 May 2011 20:24:35 +0200 Subject: Revert "Right click and clic-drag on a text over background image is weird" This reverts commit 4e035a1932446c8805c75841ea1db08f863254e6. Reverted as it introduced fdo#36496 --- sw/source/core/layout/trvlfrm.cxx | 92 +++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 2673082d5468..17b9a29ee78b 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -162,63 +162,63 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint, aPoint.Y() = Min( aPoint.Y(), Frm().Bottom() ); } - //Wenn kein Cntnt unterhalb der Seite 'antwortet', so korrigieren - //wir den StartPoint und fangen nochmal eine Seite vor der - //aktuellen an. Mit Flys ist es dann allerdings vorbei. - if ( SwLayoutFrm::GetCrsrOfst( pPos, aPoint, pCMS ) ) - bRet = sal_True; - else + //Koennte ein Freifliegender gemeint sein? + //Wenn sein Inhalt geschuetzt werden soll, so ist nix mit Crsr + //hineinsetzen, dadurch sollten alle Aenderungen unmoeglich sein. + if ( GetSortedObjs() ) { - if ( pCMS && (pCMS->bStop || pCMS->bExactOnly) ) + SwOrderIter aIter( this ); + aIter.Top(); + while ( aIter() ) { - ((SwCrsrMoveState*)pCMS)->bStop = sal_True; - return sal_False; - } - const SwCntntFrm *pCnt = GetCntntPos( aPoint, sal_False, sal_False, sal_False, pCMS, sal_False ); - if ( pCMS && pCMS->bStop ) - return sal_False; - - OSL_ENSURE( pCnt, "Crsr is gone to a Black hole" ); - if( pCMS && pCMS->pFill && pCnt->IsTxtFrm() ) - bRet = pCnt->GetCrsrOfst( pPos, rPoint, pCMS ); - else - bRet = pCnt->GetCrsrOfst( pPos, aPoint, pCMS ); + const SwVirtFlyDrawObj* pObj = + static_cast(aIter()); + const SwFlyFrm* pFly = pObj ? pObj->GetFlyFrm() : 0; + if ( pFly && + ( ( pCMS ? pCMS->bSetInReadOnly : sal_False ) || + !pFly->IsProtected() ) && + pFly->GetCrsrOfst( pPos, aPoint, pCMS ) ) + { + bRet = sal_True; + break; + } - if ( !bRet ) - { - // Set point to pCnt, delete mark - // this may happen, if pCnt is hidden - *pPos = SwPosition( *pCnt->GetNode(), SwIndex( (SwTxtNode*)pCnt->GetNode(), 0 ) ); - bRet = sal_True; + if ( pCMS && pCMS->bStop ) + return sal_False; + aIter.Prev(); } } if ( !bRet ) { - //Koennte ein Freifliegender gemeint sein? - //Wenn sein Inhalt geschuetzt werden soll, so ist nix mit Crsr - //hineinsetzen, dadurch sollten alle Aenderungen unmoeglich sein. - if ( GetSortedObjs() ) + //Wenn kein Cntnt unterhalb der Seite 'antwortet', so korrigieren + //wir den StartPoint und fangen nochmal eine Seite vor der + //aktuellen an. Mit Flys ist es dann allerdings vorbei. + if ( SwLayoutFrm::GetCrsrOfst( pPos, aPoint, pCMS ) ) + bRet = sal_True; + else { - SwOrderIter aIter( this ); - aIter.Top(); - while ( aIter() ) + if ( pCMS && (pCMS->bStop || pCMS->bExactOnly) ) { - const SwVirtFlyDrawObj* pObj = - static_cast(aIter()); - const SwFlyFrm* pFly = pObj ? pObj->GetFlyFrm() : 0; - if ( pFly && - ( ( pCMS ? pCMS->bSetInReadOnly : sal_False ) || - !pFly->IsProtected() ) && - pFly->GetCrsrOfst( pPos, aPoint, pCMS ) ) - { - bRet = sal_True; - break; - } + ((SwCrsrMoveState*)pCMS)->bStop = sal_True; + return sal_False; + } + const SwCntntFrm *pCnt = GetCntntPos( aPoint, sal_False, sal_False, sal_False, pCMS, sal_False ); + if ( pCMS && pCMS->bStop ) + return sal_False; - if ( pCMS && pCMS->bStop ) - return sal_False; - aIter.Prev(); + OSL_ENSURE( pCnt, "Crsr is gone to a Black hole" ); + if( pCMS && pCMS->pFill && pCnt->IsTxtFrm() ) + bRet = pCnt->GetCrsrOfst( pPos, rPoint, pCMS ); + else + bRet = pCnt->GetCrsrOfst( pPos, aPoint, pCMS ); + + if ( !bRet ) + { + // Set point to pCnt, delete mark + // this may happen, if pCnt is hidden + *pPos = SwPosition( *pCnt->GetNode(), SwIndex( (SwTxtNode*)pCnt->GetNode(), 0 ) ); + bRet = sal_True; } } } -- cgit v1.2.3 From bf7c12a8695f6a5194ec997db67a1af221d5e3fb Mon Sep 17 00:00:00 2001 From: Andras Timar Date: Sun, 8 May 2011 06:31:11 +0200 Subject: real solution to globlmn.hrc localization problem on Windows --- svx/AllLangResTarget_svx.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/svx/AllLangResTarget_svx.mk b/svx/AllLangResTarget_svx.mk index 0e07698f55f6..ae19390676b3 100644 --- a/svx/AllLangResTarget_svx.mk +++ b/svx/AllLangResTarget_svx.mk @@ -117,7 +117,7 @@ else ifneq ($(gb_lastrun_globlmn),MERGED) .PHONY : $(WORKDIR)/inc/svx/globlmn.hrc endif -$(WORKDIR)/inc/svx/globlmn.hrc : $(realpath $(SRCDIR)/svx/inc/globlmn_tmpl.hrc) $(gb_SrsPartMergeTarget_SDFLOCATION)/svx/inc/localize.sdf +$(WORKDIR)/inc/svx/globlmn.hrc : $(realpath $(SRCDIR)/svx/inc/globlmn_tmpl.hrc) $(realpath $(gb_SrsPartMergeTarget_SDFLOCATION)/svx/inc/localize.sdf) echo merging $@ -mkdir -p $(WORKDIR)/inc/svx rm -f $(WORKDIR)/inc/svx/lastrun.mk @@ -125,7 +125,7 @@ $(WORKDIR)/inc/svx/globlmn.hrc : $(realpath $(SRCDIR)/svx/inc/globlmn_tmpl.hrc) $(call gb_Helper_abbreviate_dirs_native, \ $(gb_SrsPartMergeTarget_TRANSEXCOMMAND) \ -p svx \ - -i $< -o $@ -m $(gb_SrsPartMergeTarget_SDFLOCATION)/svx/inc/localize.sdf -l all) + -i $< -o $@ -m $(realpath $(gb_SrsPartMergeTarget_SDFLOCATION)/svx/inc/localize.sdf) -l all) $(call gb_Deliver_deliver, $@, $(OUTDIR)/inc/svx/globlmn.hrc) endif -- cgit v1.2.3 From 4c9275720e7593b020fd8c691ae58aa072a9fa3c Mon Sep 17 00:00:00 2001 From: Andras Timar Date: Sun, 8 May 2011 06:35:21 +0200 Subject: Revert "use $realpath()" - fdo#36927 This reverts commit 5fbddf4910999590edcf557efa1a6a4b9cdd5664. --- solenv/gbuild/AllLangResTarget.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solenv/gbuild/AllLangResTarget.mk b/solenv/gbuild/AllLangResTarget.mk index 2db1d80d2ece..24123d1af125 100644 --- a/solenv/gbuild/AllLangResTarget.mk +++ b/solenv/gbuild/AllLangResTarget.mk @@ -47,7 +47,7 @@ gb_SrsPartMergeTarget_TRANSEXTARGET := $(call gb_Executable_get_target,transex3) # gb_SrsPartMergeTarget_TRANSEXPRECOMMAND is set by the platforms gb_SrsPartMergeTarget_TRANSEXCOMMAND := $(gb_SrsPartMergeTarget_TRANSEXPRECOMMAND) $(gb_SrsPartMergeTarget_TRANSEXTARGET) -gb_SrsPartMergeTarget_SDFLOCATION := $(realpath $(SRCDIR)/translations/$(INPATH)/misc/sdf/) +gb_SrsPartMergeTarget_SDFLOCATION := $(SRCDIR)/translations/$(INPATH)/misc/sdf/ gb_SrsPartMergeTarget_REPOS := $(gb_REPOS) define gb_SrsPartMergeTarget__command -- cgit v1.2.3 From d97e4098dccc08c41c3d5c9538950de4d590cb87 Mon Sep 17 00:00:00 2001 From: Andras Timar Date: Sun, 8 May 2011 17:37:27 +0200 Subject: Missing bundled English dictionary extension dict-en - fdo#36926 --- scp2/source/ooo/module_ooo.scp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scp2/source/ooo/module_ooo.scp b/scp2/source/ooo/module_ooo.scp index 3142ac6e0e20..293878bc9e71 100644 --- a/scp2/source/ooo/module_ooo.scp +++ b/scp2/source/ooo/module_ooo.scp @@ -149,7 +149,7 @@ Module gid_Module_Root_Extension_Dictionary_En Files = (gid_File_Extension_Dictionary_En); InstallOrder = "2000"; Sortkey = "550"; - Spellcheckerlanguage = "en-US"; + Spellcheckerlanguage = "en"; PackageInfo = "packinfo_office.txt"; ParentID = gid_Module_Dictionaries; Styles = (); -- cgit v1.2.3 From ca74828be241c92190e4d3ef4af85f4566caa379 Mon Sep 17 00:00:00 2001 From: Andras Timar Date: Sun, 8 May 2011 17:39:42 +0200 Subject: don't pack en dictionaries to en-US langpack --- setup_native/source/packinfo/spellchecker_selection.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_native/source/packinfo/spellchecker_selection.txt b/setup_native/source/packinfo/spellchecker_selection.txt index 34ea3b29e4a3..a628509d63d6 100644 --- a/setup_native/source/packinfo/spellchecker_selection.txt +++ b/setup_native/source/packinfo/spellchecker_selection.txt @@ -29,7 +29,7 @@ dgo = "EMPTY" dz = "EMPTY" el = "EMPTY" en-GB = "EMPTY" -en-US = "en,af,br,ca,cs,da,de-AT,de-CH,de-DE,es,et,fr,gl,he,hr,hu,it,ku-TR,lt,ne,nl,no,oc,pl,pt,ro,ru,sk,sl,sr,sv,sw,th,uk,vi,zu" +en-US = "EMPTY,af,br,ca,cs,da,de-AT,de-CH,de-DE,en,es,et,fr,gl,he,hr,hu,it,ku-TR,lt,ne,nl,no,oc,pl,pt,ro,ru,sk,sl,sr,sv,sw,th,uk,vi,zu" en-ZA = "EMPTY" eo = "EMPTY" es = "EMPTY" -- cgit v1.2.3 From e654b65df113bf5ffc4ab549d2d08c3f40fc49ef Mon Sep 17 00:00:00 2001 From: Kalman Szalai - KAMI Date: Sun, 8 May 2011 22:59:35 +0200 Subject: Additional settings for OxygenOffice product --- instsetoo_native/util/openoffice.lst | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/instsetoo_native/util/openoffice.lst b/instsetoo_native/util/openoffice.lst index 785b203c448d..d8460cc1fc32 100644 --- a/instsetoo_native/util/openoffice.lst +++ b/instsetoo_native/util/openoffice.lst @@ -400,7 +400,6 @@ OxygenOffice variables { PRODUCTNAME OxygenOffice - PRODUCTNAME_BR OxygenOffice PRODUCTVERSION 3.4 PRODUCTEXTENSION LONG_PRODUCTEXTENSION @@ -436,12 +435,10 @@ OxygenOffice STUBUPGRADECODE {0E7B27B8-D658-4BF9-98D6-EC361582EB4A} CHANGETARGETDIR 1 USE_FILEVERSION 1 - LIBRARYVERSION 9.3.0 + LIBRARYVERSION 9.4.0 PATCHCODEFILE ooo_patchcodes.txt DOWNLOADBANNER ooobanner_ooop.bmp DOWNLOADBITMAP ooobitmap_ooop.bmp - DOWNLOADBANNER_BR ooobanner_ooop.bmp - DOWNLOADBITMAP_BR ooobitmap_ooop.bmp DOWNLOADSETUPICO ooosetup.ico RELATIVE_PATHES_IN_DDF 1 STARTCENTER_ADDFEATURE_URL http://extensions.libreoffice.org/ @@ -469,7 +466,6 @@ OxygenOffice_wJRE variables { PRODUCTNAME OxygenOffice - PRODUCTNAME_BR OxygenOffice PRODUCTVERSION 3.4 PRODUCTEXTENSION LONG_PRODUCTEXTENSION @@ -479,7 +475,7 @@ OxygenOffice_wJRE BRANDPACKAGEVERSION 3.4 USERDIRPRODUCTVERSION 3 ABOUTBOXPRODUCTVERSION 3.4.0 - BASEPRODUCTVERSION 3.3 + BASEPRODUCTVERSION 3.4 UPDATEURL http://update.libreoffice.org/ProductUpdateService/check.Update ODFNOTIFYURL http://odfnotify.libreoffice.org/OOo3.0/notification.jsp?version=ODF ADD_INCLUDE_FILES cliureversion.mk,clioootypesversion.mk,javaversion2.dat,userland.txt,version.lst @@ -505,13 +501,11 @@ OxygenOffice_wJRE STUBUPGRADECODE {0E7B27B8-D658-4BF9-98D6-EC361582EB4A} CHANGETARGETDIR 1 USE_FILEVERSION 1 - LIBRARYVERSION 9.3.0 + LIBRARYVERSION 9.4.0 PATCHCODEFILE ooo_patchcodes.txt JAVAPRODUCT 1 DOWNLOADBANNER ooobanner_ooop.bmp DOWNLOADBITMAP ooobitmap_ooop.bmp - DOWNLOADBANNER_BR ooobanner_ooop.bmp - DOWNLOADBITMAP_BR ooobitmap_ooop.bmp DOWNLOADSETUPICO ooosetup.ico RELATIVE_PATHES_IN_DDF 1 STARTCENTER_ADDFEATURE_URL http://extensions.libreoffice.org/ -- cgit v1.2.3 From 63b5cc9dc287f1f0a91bfa7b60c8a68cc7f76d82 Mon Sep 17 00:00:00 2001 From: Kalman Szalai - KAMI Date: Mon, 9 May 2011 10:59:19 +0200 Subject: OxygenOffice progressbar --- instsetoo_native/util/openoffice.lst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/instsetoo_native/util/openoffice.lst b/instsetoo_native/util/openoffice.lst index d8460cc1fc32..2e6ef999340e 100644 --- a/instsetoo_native/util/openoffice.lst +++ b/instsetoo_native/util/openoffice.lst @@ -439,6 +439,10 @@ OxygenOffice PATCHCODEFILE ooo_patchcodes.txt DOWNLOADBANNER ooobanner_ooop.bmp DOWNLOADBITMAP ooobitmap_ooop.bmp + PROGRESSBARCOLOR 126,170,23 + PROGRESSSIZE 430,5 + PROGRESSPOSITION 5,230 + PROGRESSFRAMECOLOR 207,208,211 DOWNLOADSETUPICO ooosetup.ico RELATIVE_PATHES_IN_DDF 1 STARTCENTER_ADDFEATURE_URL http://extensions.libreoffice.org/ @@ -507,6 +511,10 @@ OxygenOffice_wJRE DOWNLOADBANNER ooobanner_ooop.bmp DOWNLOADBITMAP ooobitmap_ooop.bmp DOWNLOADSETUPICO ooosetup.ico + PROGRESSBARCOLOR 126,170,23 + PROGRESSSIZE 430,5 + PROGRESSPOSITION 5,230 + PROGRESSFRAMECOLOR 207,208,211 RELATIVE_PATHES_IN_DDF 1 STARTCENTER_ADDFEATURE_URL http://extensions.libreoffice.org/ STARTCENTER_INFO_URL http://www.libreoffice.org/ -- cgit v1.2.3 From c8098382da6a7a0448ff8051cac467f91d7e0b36 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Sun, 8 May 2011 14:13:51 +0200 Subject: Fix osl_Security::getHomeDir test under fakeroot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fakeroot uses LD_PRELOAD to let getuid() return 0, so getpwuid() will not return the correct home directory. If we are under fakeroot, the HOME environment variable can be used to do so. Signed-off-by: Fridrich Štrba --- sal/qa/osl/security/osl_Security.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sal/qa/osl/security/osl_Security.cxx b/sal/qa/osl/security/osl_Security.cxx index 0094ea388541..9025e8fd9b22 100644 --- a/sal/qa/osl/security/osl_Security.cxx +++ b/sal/qa/osl/security/osl_Security.cxx @@ -393,8 +393,11 @@ void MyTestPlugInImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *, strUserName = ::rtl::OUString::createFromAscii( pw->pw_name ); /// get home directory; + char *pw_dir = pw->pw_dir; + if( getenv( "FAKEROOTKEY" ) ) + pw_dir = getenv("HOME"); CPPUNIT_ASSERT_MESSAGE( "#Convert from system path to URL failed.", - ::osl::File::E_None == ::osl::File::getFileURLFromSystemPath( ::rtl::OUString::createFromAscii( pw->pw_dir ), strHomeDirectory ) ); + ::osl::File::E_None == ::osl::File::getFileURLFromSystemPath( ::rtl::OUString::createFromAscii( pw_dir ), strHomeDirectory ) ); /// get config directory; strConfigDirectory = strHomeDirectory.copy(0); -- cgit v1.2.3 From 70218ae8ef57b96f8064780adebcee3245757b58 Mon Sep 17 00:00:00 2001 From: Arnaud Versini Date: Sun, 8 May 2011 15:14:57 +0200 Subject: Resolving fdo#36931 : Load non blank chars from XML and check it's value. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fridrich Štrba --- sw/source/core/doc/doc.cxx | 2 +- sw/source/filter/xml/xmlmeta.cxx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index a031aa86098f..7c4e1984b819 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -1947,7 +1947,7 @@ void SwDoc::ResetModified() mbModified = sal_False; // If there is already a document statistic, we assume that // it is correct. In this case we reset the modified flag. - if ( 0 != pDocStat->nChar ) + if ( 0 != pDocStat->nCharExcludingSpaces ) pDocStat->bModified = sal_False; GetIDocumentUndoRedo().SetUndoNoModifiedPosition(); if( nCall && aOle2Link.IsSet() ) diff --git a/sw/source/filter/xml/xmlmeta.cxx b/sw/source/filter/xml/xmlmeta.cxx index 92c743518cb6..be0e7d42d286 100644 --- a/sw/source/filter/xml/xmlmeta.cxx +++ b/sw/source/filter/xml/xmlmeta.cxx @@ -94,6 +94,7 @@ enum SvXMLTokenMapAttrs XML_TOK_META_STAT_PARA = 16, XML_TOK_META_STAT_WORD = 32, XML_TOK_META_STAT_CHAR = 64, + XML_TOK_META_STAT_NON_WHITE_SPACE_CHAR = 128, XML_TOK_META_STAT_END=XML_TOK_UNKNOWN }; @@ -112,6 +113,7 @@ static const struct statistic s_stats [] = { { XML_TOK_META_STAT_PARA, "ParagraphCount", 0, &SwDocStat::nPara }, { XML_TOK_META_STAT_WORD, "WordCount", 0, &SwDocStat::nWord }, { XML_TOK_META_STAT_CHAR, "CharacterCount", 0, &SwDocStat::nChar }, + { XML_TOK_META_STAT_NON_WHITE_SPACE_CHAR, "NonWhitespaceCharacterCount", 0, &SwDocStat::nCharExcludingSpaces }, { XML_TOK_META_STAT_END, 0, 0, 0 } }; @@ -149,7 +151,7 @@ void SwXMLImport::SetStatistics( } } - if( 127 == nTokens ) + if( 255 == nTokens ) aDocStat.bModified = sal_False; if( nTokens ) pDoc->SetDocStat( aDocStat ); -- cgit v1.2.3 From 87928074058740b003e71111d856ab02138cfa4a Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Mon, 9 May 2011 16:08:45 +0200 Subject: use Cwd::realpath to avoid confusion with symlinked dirs --- solenv/bin/modules/installer/parameter.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solenv/bin/modules/installer/parameter.pm b/solenv/bin/modules/installer/parameter.pm index f17965fa3d7f..8c844d55609c 100644 --- a/solenv/bin/modules/installer/parameter.pm +++ b/solenv/bin/modules/installer/parameter.pm @@ -161,7 +161,7 @@ sub getparameter elsif ($param eq "-destdir") # new parameter for simple installer { $installer::globals::rootpath ne "" && die "must set destdir before -i or -simple"; - $installer::globals::destdir = shift @ARGV; + $installer::globals::destdir = Cwd::realpath( shift @ARGV ); } elsif ($param eq "-simple") # new parameter for simple installer { -- cgit v1.2.3 From 018c43bc46a55b9ecee3d7376372b4d8c272706c Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Fri, 6 May 2011 18:19:22 +0200 Subject: Fix non-changeability of UI locale Enabled commented-out code, that actually permits changing the ui locale without having to go through configuration. This permits forcing en-us locale from the unit tests (which don't have a working config) --- unotools/source/config/syslocaleoptions.cxx | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/unotools/source/config/syslocaleoptions.cxx b/unotools/source/config/syslocaleoptions.cxx index 2b6f4f2cdc1b..9c071cea2dd1 100644 --- a/unotools/source/config/syslocaleoptions.cxx +++ b/unotools/source/config/syslocaleoptions.cxx @@ -273,19 +273,16 @@ void SvtSysLocaleOptions_Impl::MakeRealLocale() void SvtSysLocaleOptions_Impl::MakeRealUILocale() { - if ( !m_aRealUILocale.Language.getLength() ) + // as we can't switch UILocale at runtime, we only store changes in the configuration + m_aRealUILocale = lcl_str_to_locale( m_aUILocaleString ); + if ( m_aRealUILocale.Language.getLength() ) { - // as we can't switch UILocale at runtime, we only store changes in the configuration - m_aRealUILocale = lcl_str_to_locale( m_aUILocaleString ); - if ( m_aRealUILocale.Language.getLength() ) - { - m_eRealUILanguage = MsLangId::convertLocaleToLanguage( m_aRealUILocale ); - } - else - { - m_eRealUILanguage = MsLangId::getSystemUILanguage(); - MsLangId::convertLanguageToLocale( m_eRealUILanguage, m_aRealUILocale ); - } + m_eRealUILanguage = MsLangId::convertLocaleToLanguage( m_aRealUILocale ); + } + else + { + m_eRealUILanguage = MsLangId::getSystemUILanguage(); + MsLangId::convertLanguageToLocale( m_eRealUILanguage, m_aRealUILocale ); } } @@ -399,13 +396,12 @@ void SvtSysLocaleOptions_Impl::SetUILocaleString( const OUString& rStr ) if (!m_bROUILocale && rStr != m_aUILocaleString ) { m_aUILocaleString = rStr; -/* + // as we can't switch UILocale at runtime, we only store changes in the configuration MakeRealUILocale(); MsLangId::setConfiguredSystemLanguage( m_eRealUILanguage ); SetModified(); NotifyListeners( SYSLOCALEOPTIONS_HINT_UILOCALE ); -*/ } } -- cgit v1.2.3 From 18936fbb3152ca5c04b2639e017129213484de40 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Fri, 6 May 2011 18:43:35 +0200 Subject: Force calc unit test to use en-US locale and strings --- sc/qa/unit/ucalc.cxx | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index e7ab145c4aaa..56e205c696a2 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -49,6 +49,8 @@ #include #include #include +#include +#include #include #include "scdll.hxx" @@ -304,28 +306,6 @@ Test::Test() //of retaining references to the root ServiceFactory as its passed around comphelper::setProcessServiceFactory(xSM); -#if 0 - // TODO: attempt to explicitly set UI locale to en-US, to get the unit - // test to work under non-English build environment. But this causes - // runtime exception.... - uno::Reference theConfigProvider = - uno::Reference ( - xSM->createInstance( - OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider"))), uno::UNO_QUERY_THROW); - - uno::Sequence theArgs(1); - OUString aLocalePath(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Linguistic/General")); - theArgs[0] <<= aLocalePath; - uno::Reference xProp( - theConfigProvider->createInstanceWithArguments( - OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationUpdateAccess")), theArgs), uno::UNO_QUERY_THROW); - - OUString aLang(RTL_CONSTASCII_USTRINGPARAM("en-US")); - uno::Any aAny; - aAny <<= aLang; - xProp->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("UILocale")), aAny); -#endif - // initialise UCB-Broker uno::Sequence aUcbInitSequence(2); aUcbInitSequence[0] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Local")); @@ -339,8 +319,19 @@ Test::Test() rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.FileContentProvider"))), uno::UNO_QUERY); xUcb->registerContentProvider(xFileProvider, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file")), sal_True); - InitVCL(xSM); + // force locale (and resource files loaded) to en-US + const LanguageType eLang=LANGUAGE_ENGLISH_US; + rtl::OUString aLang, aCountry; + MsLangId::convertLanguageToIsoNames(eLang, aLang, aCountry); + lang::Locale aLocale(aLang, aCountry, rtl::OUString()); + ResMgr::SetDefaultLocale( aLocale ); + + SvtSysLocaleOptions aLocalOptions; + aLocalOptions.SetUILocaleConfigString( + MsLangId::convertLanguageToIsoString( eLang ) ); + + InitVCL(xSM); ScDLL::Init(); oslProcessError err = osl_getProcessWorkingDir(&m_aPWDURL.pData); -- cgit v1.2.3 From 746504762ea5b5412144d17555e995bac9f08941 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Mon, 9 May 2011 16:18:13 +0200 Subject: Unit test locale now forced by other means This was only working for Linux, anyway. --- solenv/gbuild/CppunitTest.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk index 5c33719a2edb..df8e8a651ff0 100644 --- a/solenv/gbuild/CppunitTest.mk +++ b/solenv/gbuild/CppunitTest.mk @@ -36,7 +36,7 @@ export DBGSV_ERROR_OUT # gb_CppunitTest_TARGETTYPE # gb_CppunitTest_get_filename gb_CppunitTest_CPPTESTTARGET := $(call gb_Executable_get_target,cppunit/cppunittester) -gb_CppunitTest_CPPTESTCOMMAND := $(gb_CppunitTest_CPPTESTPRECOMMAND) STAR_RESOURCEPATH=$(dir $(call gb_ResTarget_get_outdir_target,example)) LANG=en_US.UTF-8 $(gb_CppunitTest_GDBTRACE) $(gb_CppunitTest_CPPTESTTARGET) +gb_CppunitTest_CPPTESTCOMMAND := $(gb_CppunitTest_CPPTESTPRECOMMAND) STAR_RESOURCEPATH=$(dir $(call gb_ResTarget_get_outdir_target,example)) $(gb_CppunitTest_GDBTRACE) $(gb_CppunitTest_CPPTESTTARGET) gb_CppunitTest__get_linktargetname = CppunitTest/$(call gb_CppunitTest_get_filename,$(1)) .PHONY : $(call gb_CppunitTest_get_clean_target,%) -- cgit v1.2.3 From d08605b52c85e4f7ab79ece8d73f155dab8d1b3d Mon Sep 17 00:00:00 2001 From: Noel Power Date: Mon, 9 May 2011 15:31:50 +0100 Subject: revert ( unintended ) parts commit b9ff593590532eb012a0520b6dcb40f3be51f845 it seems that some unintentional experimental fixes for fdo#34908 snuck into the commit about ( which was for another filter problem ). That fix ( in master ) then managed to find its way into the 3.4 branch :-( --- sw/source/core/text/portxt.cxx | 2 +- sw/source/filter/ww8/docxattributeoutput.cxx | 4 +--- sw/source/filter/ww8/wrtww8.cxx | 4 +--- sw/source/filter/ww8/ww8par3.cxx | 2 +- sw/source/ui/docvw/edtwin.cxx | 7 +++---- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx index a84ccb6b52de..c72c22fb02f9 100644 --- a/sw/source/core/text/portxt.cxx +++ b/sw/source/core/text/portxt.cxx @@ -820,7 +820,7 @@ void SwFieldFormPortion::Paint( const SwTxtPaintInfo& rInf ) const { if ( pBM->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) ) { // a checkbox... - ICheckboxFieldmark* pCheckboxFm = reinterpret_cast< ICheckboxFieldmark* >(pBM); + ICheckboxFieldmark* pCheckboxFm = dynamic_cast< ICheckboxFieldmark* >(pBM); bool checked = pCheckboxFm->IsChecked(); rInf.DrawCheckBox(*this, checked); } diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index bc60b3e21e74..357aded1322d 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -657,9 +657,7 @@ void DocxAttributeOutput::WriteFFData( const FieldInfos& rInfos ) FieldMarkParamsHelper params( rFieldmark ); params.extractParam( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_FORMCHECKBOX_NAME ) ), sName ); - const sw::mark::ICheckboxFieldmark* pCheckboxFm = NULL; - if ( rFieldmark.GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) ) - pCheckboxFm = reinterpret_cast(&rFieldmark); + const sw::mark::ICheckboxFieldmark* pCheckboxFm = dynamic_cast(&rFieldmark); if ( pCheckboxFm && pCheckboxFm->IsChecked() ) bChecked = true; diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 81920922c145..fe160b9493fe 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3522,9 +3522,7 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ) return; const ::sw::mark::IFieldmark* pFieldmark = &rFieldmark; - const ::sw::mark::ICheckboxFieldmark* pAsCheckbox = NULL; - if ( rFieldmark.GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) ) - pAsCheckbox = reinterpret_cast< const ::sw::mark::ICheckboxFieldmark* >( pFieldmark ); + const ::sw::mark::ICheckboxFieldmark* pAsCheckbox = dynamic_cast< const ::sw::mark::ICheckboxFieldmark* >( pFieldmark ); OSL_ENSURE(rFieldmark.GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) || diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 6d014a08a61a..45cc68c4cdfc 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -225,7 +225,7 @@ eF_ResT SwWW8ImplReader::Read_F_FormCheckBox( WW8FieldDesc* pF, String& rStr ) OSL_ENSURE(pFieldmark!=NULL, "hmmm; why was the bookmark not created?"); if (pFieldmark!=NULL) { IFieldmark::parameter_map_t* const pParameters = pFieldmark->GetParameters(); - ICheckboxFieldmark* pCheckboxFm = reinterpret_cast(pFieldmark); + ICheckboxFieldmark* pCheckboxFm = dynamic_cast(pFieldmark); (*pParameters)[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMCHECKBOX_NAME))] = uno::makeAny(::rtl::OUString(aFormula.sTitle)); (*pParameters)[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMCHECKBOX_HELPTEXT))] = uno::makeAny(::rtl::OUString(aFormula.sToolTip)); diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index c78cedad805c..818aec6e04a3 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -2195,9 +2195,8 @@ KEYINPUT_CHECKTABLE_INSDEL: case KS_InsChar: if (rSh.GetChar(sal_False)==CH_TXT_ATR_FORMELEMENT) { - ::sw::mark::ICheckboxFieldmark* pFieldmark = NULL; - if ( rSh.GetCurrentFieldmark() && rSh.GetCurrentFieldmark()->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) ) - pFieldmark = reinterpret_cast< ::sw::mark::ICheckboxFieldmark* > + ::sw::mark::ICheckboxFieldmark* pFieldmark = + dynamic_cast< ::sw::mark::ICheckboxFieldmark* > (rSh.GetCurrentFieldmark()); OSL_ENSURE(pFieldmark, "Where is my FieldMark??"); @@ -4119,7 +4118,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) IFieldmark *fieldBM = const_cast< IFieldmark* > ( aCntntAtPos.aFnd.pFldmark ); if (fieldBM->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) ) { - ICheckboxFieldmark* pCheckboxFm = reinterpret_cast(fieldBM); + ICheckboxFieldmark* pCheckboxFm = dynamic_cast(fieldBM); pCheckboxFm->SetChecked(!pCheckboxFm->IsChecked()); pCheckboxFm->Invalidate(); rSh.InvalidateWindows( rView.GetVisArea() ); -- cgit v1.2.3 From 55f05879eefd6a01bc4f8a8adbc967973d2aee9d Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Wed, 4 May 2011 20:12:41 +0200 Subject: add implementation for new uno interface XUnnamedDatabaseRange Signed-off-by: Kohei Yoshida --- sc/inc/datauno.hxx | 30 +++++++++++ sc/source/ui/unoobj/datauno.cxx | 115 +++++++++++++++++++++++++++++++++++++--- 2 files changed, 138 insertions(+), 7 deletions(-) diff --git a/sc/inc/datauno.hxx b/sc/inc/datauno.hxx index cf47b7b3bc62..34345e4a3c07 100644 --- a/sc/inc/datauno.hxx +++ b/sc/inc/datauno.hxx @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -501,6 +502,8 @@ private: String aName; SfxItemPropertySet aPropSet; XDBRefreshListenerArr_Impl aRefreshListeners; + bool bIsUnnamed; + SCTAB aTab; private: ScDBData* GetDBData_Impl() const; @@ -508,6 +511,7 @@ private: public: ScDatabaseRangeObj(ScDocShell* pDocSh, const String& rNm); + ScDatabaseRangeObj(ScDocShell* pDocSh, const SCTAB nTab); virtual ~ScDatabaseRangeObj(); virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); @@ -662,6 +666,32 @@ public: throw(::com::sun::star::uno::RuntimeException); }; +class ScUnnamedDatabaseRangesObj : public cppu::WeakImplHelper1< + com::sun::star::sheet::XUnnamedDatabaseRanges>, + public SfxListener +{ +private: + ScDocShell* pDocShell; + +public: + ScUnnamedDatabaseRangesObj(ScDocShell* pDocSh); + virtual ~ScUnnamedDatabaseRangesObj(); + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + // XUnnamedDatabaseRanges + virtual void SAL_CALL setByTable( const ::com::sun::star::table::CellRangeAddress& aRange ) + throw(::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException ); + virtual com::sun::star::uno::Any SAL_CALL getByTable( const sal_Int32 nTab ) + throw(::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::container::NoSuchElementException ); + virtual sal_Bool SAL_CALL hasByTable( sal_Int32 nTab ) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); +}; + #endif diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx index f5f2ab6071d0..4e3cff0b681a 100644 --- a/sc/source/ui/unoobj/datauno.cxx +++ b/sc/source/ui/unoobj/datauno.cxx @@ -57,6 +57,7 @@ #include "docsh.hxx" #include "dbdocfun.hxx" #include "unonames.hxx" +#include "globalnames.hxx" #include "globstr.hrc" #include "convuno.hxx" #include "hints.hxx" @@ -1607,7 +1608,18 @@ void ScDataPilotFilterDescriptor::PutData( const ScQueryParam& rParam ) ScDatabaseRangeObj::ScDatabaseRangeObj(ScDocShell* pDocSh, const String& rNm) : pDocShell( pDocSh ), aName( rNm ), - aPropSet( lcl_GetDBRangePropertyMap() ) + aPropSet( lcl_GetDBRangePropertyMap() ), + bIsUnnamed(false) +{ + pDocShell->GetDocument()->AddUnoObject(*this); +} + +ScDatabaseRangeObj::ScDatabaseRangeObj(ScDocShell* pDocSh, const SCTAB nTab) : + pDocShell( pDocSh ), + aName(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME)), + aPropSet( lcl_GetDBRangePropertyMap() ), + bIsUnnamed(true), + aTab( nTab ) { pDocShell->GetDocument()->AddUnoObject(*this); } @@ -1641,12 +1653,19 @@ ScDBData* ScDatabaseRangeObj::GetDBData_Impl() const ScDBData* pRet = NULL; if (pDocShell) { - ScDBCollection* pNames = pDocShell->GetDocument()->GetDBCollection(); - if (pNames) + if (bIsUnnamed) { - sal_uInt16 nPos = 0; - if (pNames->SearchName( aName, nPos )) - pRet = (*pNames)[nPos]; + pRet = pDocShell->GetDocument()->GetAnonymousDBData(aTab); + } + else + { + ScDBCollection* pNames = pDocShell->GetDocument()->GetDBCollection(); + if (pNames) + { + sal_uInt16 nPos = 0; + if (pNames->SearchName( aName, nPos )) + pRet = (*pNames)[nPos]; + } } } return pRet; @@ -2079,7 +2098,7 @@ uno::Any SAL_CALL ScDatabaseRangeObj::getPropertyValue( const rtl::OUString& aPr { // all database ranges except "unnamed" are user defined ScUnoHelpFunctions::SetBoolInAny( aRet, - ( pData->GetName() != ScGlobal::GetRscString(STR_DB_NONAME) ) ); + ( pData->GetName() != String(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME)) ) ); } else if ( aString.EqualsAscii( SC_UNO_LINKDISPBIT ) ) { @@ -2354,8 +2373,90 @@ sal_Bool SAL_CALL ScDatabaseRangesObj::hasByName( const rtl::OUString& aName ) //------------------------------------------------------------------------ +ScUnnamedDatabaseRangesObj::ScUnnamedDatabaseRangesObj(ScDocShell* pDocSh) : + pDocShell( pDocSh ) +{ + pDocShell->GetDocument()->AddUnoObject(*this); +} + +ScUnnamedDatabaseRangesObj::~ScUnnamedDatabaseRangesObj() +{ + if (pDocShell) + pDocShell->GetDocument()->RemoveUnoObject(*this); +} + +void ScUnnamedDatabaseRangesObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) +{ + // Referenz-Update interessiert hier nicht + + if ( rHint.ISA( SfxSimpleHint ) && + ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING ) + { + pDocShell = NULL; // ungueltig geworden + } +} + +// XUnnamedDatabaseRanges + +void ScUnnamedDatabaseRangesObj::setByTable( const table::CellRangeAddress& aRange ) + throw( uno::RuntimeException, + lang::IndexOutOfBoundsException ) +{ + SolarMutexGuard aGuard; + bool bDone = false; + if (pDocShell) + { + if ( pDocShell->GetDocument()->GetTableCount() >= aRange.Sheet ) + throw lang::IndexOutOfBoundsException(); + ScDBDocFunc aFunc(*pDocShell); + String aString(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME)); + ScRange aUnnamedRange( (SCCOL)aRange.StartColumn, (SCROW)aRange.StartRow, aRange.Sheet, + (SCCOL)aRange.EndColumn, (SCROW)aRange.EndRow, aRange.Sheet ); + bDone = aFunc.AddDBRange( aString, aUnnamedRange, sal_True ); + } + if (!bDone) + throw uno::RuntimeException(); // no other exceptions specified +} +uno::Any ScUnnamedDatabaseRangesObj::getByTable( const sal_Int32 nTab ) + throw(uno::RuntimeException, + lang::IndexOutOfBoundsException, + container::NoSuchElementException) +{ + SolarMutexGuard aGuard; + if (pDocShell) + { + if ( pDocShell->GetDocument()->GetTableCount() >= nTab ) + throw lang::IndexOutOfBoundsException(); + uno::Reference xRange( new ScDatabaseRangeObj(pDocShell, (SCTAB) nTab) ); + if (xRange.is()) + return uno::makeAny(xRange); + else + throw container::NoSuchElementException(); + } + else + throw uno::RuntimeException(); +} + +sal_Bool ScUnnamedDatabaseRangesObj::hasByTable( sal_Int32 nTab ) + throw (uno::RuntimeException, + lang::IndexOutOfBoundsException) +{ + SolarMutexGuard aGuard; + if (pDocShell) + { + if (pDocShell->GetDocument()->GetTableCount() >= nTab) + throw lang::IndexOutOfBoundsException(); + if (pDocShell->GetDocument()->GetAnonymousDBData((SCTAB) nTab)) + return true; + return false; + } + else + return false; +} + +//------------------------------------------------------------------------ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From ee5f0edcaf34d4ff2228ff0836969f68382502aa Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Thu, 5 May 2011 14:25:42 +0200 Subject: check for less equal, not greater equal Signed-off-by: Kohei Yoshida --- sc/source/ui/unoobj/datauno.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx index 4e3cff0b681a..e8eeeb705941 100644 --- a/sc/source/ui/unoobj/datauno.cxx +++ b/sc/source/ui/unoobj/datauno.cxx @@ -2406,7 +2406,7 @@ void ScUnnamedDatabaseRangesObj::setByTable( const table::CellRangeAddress& aRan bool bDone = false; if (pDocShell) { - if ( pDocShell->GetDocument()->GetTableCount() >= aRange.Sheet ) + if ( pDocShell->GetDocument()->GetTableCount() <= aRange.Sheet ) throw lang::IndexOutOfBoundsException(); ScDBDocFunc aFunc(*pDocShell); @@ -2427,7 +2427,7 @@ uno::Any ScUnnamedDatabaseRangesObj::getByTable( const sal_Int32 nTab ) SolarMutexGuard aGuard; if (pDocShell) { - if ( pDocShell->GetDocument()->GetTableCount() >= nTab ) + if ( pDocShell->GetDocument()->GetTableCount() <= nTab ) throw lang::IndexOutOfBoundsException(); uno::Reference xRange( new ScDatabaseRangeObj(pDocShell, (SCTAB) nTab) ); if (xRange.is()) @@ -2446,7 +2446,7 @@ sal_Bool ScUnnamedDatabaseRangesObj::hasByTable( sal_Int32 nTab ) SolarMutexGuard aGuard; if (pDocShell) { - if (pDocShell->GetDocument()->GetTableCount() >= nTab) + if (pDocShell->GetDocument()->GetTableCount() <= nTab) throw lang::IndexOutOfBoundsException(); if (pDocShell->GetDocument()->GetAnonymousDBData((SCTAB) nTab)) return true; -- cgit v1.2.3 From 8ee23e01dd7c19de4b3fc835caaef26dc3c95007 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Thu, 5 May 2011 18:17:52 +0200 Subject: make OOXML import use sheet local db data Signed-off-by: Kohei Yoshida --- oox/inc/oox/xls/workbookhelper.hxx | 6 ++++++ oox/source/token/properties.txt | 1 + oox/source/xls/autofilterbuffer.cxx | 3 +-- oox/source/xls/tablebuffer.cxx | 2 +- oox/source/xls/workbookhelper.cxx | 32 +++++++++++++++++++++++++++++++- 5 files changed, 40 insertions(+), 4 deletions(-) diff --git a/oox/inc/oox/xls/workbookhelper.hxx b/oox/inc/oox/xls/workbookhelper.hxx index fa32ea026fca..4c0670534dab 100644 --- a/oox/inc/oox/xls/workbookhelper.hxx +++ b/oox/inc/oox/xls/workbookhelper.hxx @@ -201,6 +201,12 @@ public: ::rtl::OUString& orName, const ::com::sun::star::table::CellRangeAddress& rRangeAddr ) const; + /** Creates and returns an unnamed database range on-the-fly in the Calc document. + The range will not be buffered in the global table buffer. */ + ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XDatabaseRange > + createUnnamedDatabaseRangeObject( + const ::com::sun::star::table::CellRangeAddress& rRangeAddr ) const; + /** Creates and returns a com.sun.star.style.Style object for cells or pages. */ ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle > createStyleObject( diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index f8447b64a4a7..693ccb1be7dd 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -463,6 +463,7 @@ TransitionType Transparency TriState Type +UnnamedDatabaseRanges URL Url UseFilterCriteriaSource diff --git a/oox/source/xls/autofilterbuffer.cxx b/oox/source/xls/autofilterbuffer.cxx index 7cf359f6d3c9..e7b6f321f9b0 100644 --- a/oox/source/xls/autofilterbuffer.cxx +++ b/oox/source/xls/autofilterbuffer.cxx @@ -772,8 +772,7 @@ void AutoFilterBuffer::finalizeImport( sal_Int16 nSheet ) if( pFilterDBName->getAbsoluteRange( aFilterRange ) && (aFilterRange.Sheet == nSheet) ) { // use the same name for the database range as used for the defined name '_FilterDatabase' - OUString aDBRangeName = pFilterDBName->getCalcName(); - Reference< XDatabaseRange > xDatabaseRange = createDatabaseRangeObject( aDBRangeName, aFilterRange ); + Reference< XDatabaseRange > xDatabaseRange = createUnnamedDatabaseRangeObject( aFilterRange ); // first, try to create an auto filter bool bHasAutoFilter = finalizeImport( xDatabaseRange ); // no success: try to create an advanced filter diff --git a/oox/source/xls/tablebuffer.cxx b/oox/source/xls/tablebuffer.cxx index a0ad1144b152..d3390204bce7 100644 --- a/oox/source/xls/tablebuffer.cxx +++ b/oox/source/xls/tablebuffer.cxx @@ -94,7 +94,7 @@ void Table::finalizeImport() if( (maModel.mnId > 0) && (maModel.maDisplayName.getLength() > 0) ) try { maDBRangeName = maModel.maDisplayName; - Reference< XDatabaseRange > xDatabaseRange( createDatabaseRangeObject( maDBRangeName, maModel.maRange ), UNO_SET_THROW ); + Reference< XDatabaseRange > xDatabaseRange( createUnnamedDatabaseRangeObject( maModel.maRange ), UNO_SET_THROW ); maDestRange = xDatabaseRange->getDataArea(); // get formula token index of the database range diff --git a/oox/source/xls/workbookhelper.cxx b/oox/source/xls/workbookhelper.cxx index ed13bddadfa7..b7533d3f7a2e 100644 --- a/oox/source/xls/workbookhelper.cxx +++ b/oox/source/xls/workbookhelper.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -140,6 +141,8 @@ public: Reference< XNamedRange > createNamedRangeObject( OUString& orName, sal_Int32 nNameFlags ) const; /** Creates and returns a database range on-the-fly in the Calc document. */ Reference< XDatabaseRange > createDatabaseRangeObject( OUString& orName, const CellRangeAddress& rRangeAddr ) const; + /** Creates and returns an unnamed database range on-the-fly in the Calc document. */ + Reference< XDatabaseRange > createUnnamedDatabaseRangeObject( const CellRangeAddress& rRangeAddr ) const; /** Creates and returns a com.sun.star.style.Style object for cells or pages. */ Reference< XStyle > createStyleObject( OUString& orStyleName, bool bPageStyle ) const; @@ -400,6 +403,28 @@ Reference< XDatabaseRange > WorkbookData::createDatabaseRangeObject( OUString& o return xDatabaseRange; } +Reference< XDatabaseRange > WorkbookData::createUnnamedDatabaseRangeObject( const CellRangeAddress& rRangeAddr ) const +{ + // validate cell range + CellRangeAddress aDestRange = rRangeAddr; + bool bValidRange = getAddressConverter().validateCellRange( aDestRange, true, true ); + + // create database range and insert it into the Calc document + Reference< XDatabaseRange > xDatabaseRange; + PropertySet aDocProps( mxDoc ); + Reference< XUnnamedDatabaseRanges > xDatabaseRanges( aDocProps.getAnyProperty( PROP_UnnamedDatabaseRanges ), UNO_QUERY_THROW ); + if( bValidRange ) try + { + xDatabaseRanges->setByTable( aDestRange ); + xDatabaseRange.set( xDatabaseRanges->getByTable( aDestRange.Sheet ), UNO_QUERY ); + } + catch( Exception& ) + { + } + OSL_ENSURE( xDatabaseRange.is(), "WorkbookData::createDatabaseRangeObject - cannot create database range" ); + return xDatabaseRange; +} + Reference< XStyle > WorkbookData::createStyleObject( OUString& orStyleName, bool bPageStyle ) const { Reference< XStyle > xStyle; @@ -748,6 +773,11 @@ Reference< XDatabaseRange > WorkbookHelper::createDatabaseRangeObject( OUString& return mrBookData.createDatabaseRangeObject( orName, rRangeAddr ); } +Reference< XDatabaseRange > WorkbookHelper::createUnnamedDatabaseRangeObject( const CellRangeAddress& rRangeAddr ) const +{ + return mrBookData.createUnnamedDatabaseRangeObject( rRangeAddr ); +} + Reference< XStyle > WorkbookHelper::createStyleObject( OUString& orStyleName, bool bPageStyle ) const { return mrBookData.createStyleObject( orStyleName, bPageStyle ); @@ -947,4 +977,4 @@ bool WorkbookHelperRoot::isValid() const } // namespace xls } // namespace oox -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From 884f201a0665a2a685edf892be907ab7728fae18 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Wed, 4 May 2011 21:07:31 +0200 Subject: add new uno interface for sheet local anonymous db data Signed-off-by: Kohei Yoshida --- .../com/sun/star/sheet/XUnnamedDatabaseRanges.idl | 78 ++++++++++++++++++++++ offapi/com/sun/star/sheet/makefile.mk | 1 + 2 files changed, 79 insertions(+) create mode 100644 offapi/com/sun/star/sheet/XUnnamedDatabaseRanges.idl diff --git a/offapi/com/sun/star/sheet/XUnnamedDatabaseRanges.idl b/offapi/com/sun/star/sheet/XUnnamedDatabaseRanges.idl new file mode 100644 index 000000000000..3a535617f1de --- /dev/null +++ b/offapi/com/sun/star/sheet/XUnnamedDatabaseRanges.idl @@ -0,0 +1,78 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Markus Mohrhard + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Major Contributor(s): + * Markus Mohrhard + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef __com_sun_star_sheet_XUnnamedDatabaseRanges_idl__ +#define __com_sun_star_sheet_XUnnamedDatabaseRanges_idl__ + +#ifndef __com_sun_star_table_CellRangeAddress_idl__ +#include +#endif + +#ifndef __com_sun_star_uno_XInterface_idl__ +#include +#endif + +#ifndef __com_sun_star_container_NoSuchElementException_idl__ +#include +#endif + +#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__ +#include +#endif + +//============================================================================= + +module com { module sun { module star { module sheet { + +//============================================================================= + +/** provides functions to manage the sheet local databases + */ + +interface XUnnamedDatabaseRanges: com::sun::star::uno::XInterface + { + void setByTable( [in] com::sun::star::table::CellRangeAddress aRange ) + raises( com::sun::star::lang::IndexOutOfBoundsException ); + + any getByTable( [in] long nTab ) + raises( com::sun::star::container::NoSuchElementException, + com::sun::star::lang::IndexOutOfBoundsException ); + + boolean hasByTable ( [in] long nTab ) + raises( com::sun::star::lang::IndexOutOfBoundsException ); + + }; + +//============================================================================= + +}; }; }; }; + +#endif + diff --git a/offapi/com/sun/star/sheet/makefile.mk b/offapi/com/sun/star/sheet/makefile.mk index 37a0cadacacd..10bb43d23173 100644 --- a/offapi/com/sun/star/sheet/makefile.mk +++ b/offapi/com/sun/star/sheet/makefile.mk @@ -338,6 +338,7 @@ IDLFILES=\ XSubTotalDescriptor.idl\ XSubTotalField.idl\ XUniqueCellFormatRangesSupplier.idl\ + XUnnamedDatabaseRanges.idl\ XUsedAreaCursor.idl\ XViewFreezable.idl\ XViewPane.idl\ -- cgit v1.2.3 From c831d4236f705d40b6bdd2280a15ccb56037c567 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Thu, 5 May 2011 17:59:58 +0200 Subject: use sheet local db data in ScVbaRange::Autofilter Signed-off-by: Kohei Yoshida --- sc/inc/unonames.hxx | 1 + sc/source/ui/docshell/dbdocfun.cxx | 19 +++++++++++----- sc/source/ui/inc/dbdocfun.hxx | 2 +- sc/source/ui/unoobj/datauno.cxx | 2 +- sc/source/ui/unoobj/docuno.cxx | 5 +++++ sc/source/ui/vba/excelvbahelper.cxx | 43 +++++++++++++++++-------------------- sc/source/ui/vba/excelvbahelper.hxx | 4 +++- sc/source/ui/vba/vbarange.cxx | 29 +++++++------------------ 8 files changed, 53 insertions(+), 52 deletions(-) diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx index 5fb6edaf592d..7bc50f1af812 100644 --- a/sc/inc/unonames.hxx +++ b/sc/inc/unonames.hxx @@ -48,6 +48,7 @@ #define SC_UNO_EXTERNALDOCLINKS "ExternalDocLinks" #define SC_UNO_COLLABELRNG "ColumnLabelRanges" #define SC_UNO_DATABASERNG "DatabaseRanges" +#define SC_UNO_UNNAMEDDBRNG "UnnamedDatabaseRanges" #define SC_UNO_NAMEDRANGES "NamedRanges" #define SC_UNO_ROWLABELRNG "RowLabelRanges" #define SC_UNO_SHEETLINKS "SheetLinks" diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 8991706293a1..8fde7e29e57a 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -255,7 +255,7 @@ sal_Bool ScDBDocFunc::ModifyDBData( const ScDBData& rNewData, sal_Bool /* bApi * // ----------------------------------------------------------------- -sal_Bool ScDBDocFunc::RepeatDB( const String& rDBName, sal_Bool bRecord, sal_Bool bApi ) +sal_Bool ScDBDocFunc::RepeatDB( const String& rDBName, sal_Bool bRecord, sal_Bool bApi, bool bIsUnnamed, SCTAB aTab ) { //! auch fuer ScDBFunc::RepeatDB benutzen! @@ -263,12 +263,21 @@ sal_Bool ScDBDocFunc::RepeatDB( const String& rDBName, sal_Bool bRecord, sal_Boo ScDocument* pDoc = rDocShell.GetDocument(); if (bRecord && !pDoc->IsUndoEnabled()) bRecord = false; - ScDBCollection* pColl = pDoc->GetDBCollection(); - sal_uInt16 nIndex; - if ( pColl && pColl->SearchName( rDBName, nIndex ) ) + ScDBData* pDBData = NULL; + if (bIsUnnamed) { - ScDBData* pDBData = (*pColl)[nIndex]; + pDBData = pDoc->GetAnonymousDBData( aTab ); + } + else + { + sal_uInt16 nIndex; + ScDBCollection* pColl = pDoc->GetDBCollection(); + if ( pColl && pColl->SearchName( rDBName, nIndex ) ) + pDBData = (*pColl)[nIndex]; + } + if ( pDBData ) + { ScQueryParam aQueryParam; pDBData->GetQueryParam( aQueryParam ); sal_Bool bQuery = aQueryParam.GetEntry(0).bDoQuery; diff --git a/sc/source/ui/inc/dbdocfun.hxx b/sc/source/ui/inc/dbdocfun.hxx index 132eb9a3750b..11b2ce27ef62 100644 --- a/sc/source/ui/inc/dbdocfun.hxx +++ b/sc/source/ui/inc/dbdocfun.hxx @@ -114,7 +114,7 @@ public: sal_Bool RenameDBRange( const String& rOld, const String& rNew, sal_Bool bApi ); sal_Bool ModifyDBData( const ScDBData& rNewData, sal_Bool bApi ); // Name unveraendert - sal_Bool RepeatDB( const String& rDBName, sal_Bool bRecord, sal_Bool bApi ); + sal_Bool RepeatDB( const String& rDBName, sal_Bool bRecord, sal_Bool bApi, bool bIsUnnamed=false, SCTAB aTab = 0); sal_Bool DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewObj, sal_Bool bRecord, sal_Bool bApi, sal_Bool bAllowMove = false ); diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx index e8eeeb705941..a1ee63dc8b26 100644 --- a/sc/source/ui/unoobj/datauno.cxx +++ b/sc/source/ui/unoobj/datauno.cxx @@ -1908,7 +1908,7 @@ void SAL_CALL ScDatabaseRangeObj::refresh() throw(uno::RuntimeException) // interne Operationen (sort, query, subtotal) nur, wenn kein Fehler if (bContinue) - aFunc.RepeatDB( pData->GetName(), sal_True, sal_True ); + aFunc.RepeatDB( pData->GetName(), true, true, bIsUnnamed, aTab ); } } diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index e84f6756757e..15673f35c0b8 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -1780,6 +1781,10 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const rtl::OUString& aPropertyNa { aRet <<= uno::Reference(new ScDatabaseRangesObj( pDocShell )); } + else if ( aString.EqualsAscii( SC_UNO_UNNAMEDDBRNG ) ) + { + aRet <<= uno::Reference(new ScUnnamedDatabaseRangesObj(pDocShell)); + } else if ( aString.EqualsAscii( SC_UNO_COLLABELRNG ) ) { aRet <<= uno::Reference(new ScLabelRangesObj( pDocShell, sal_True )); diff --git a/sc/source/ui/vba/excelvbahelper.cxx b/sc/source/ui/vba/excelvbahelper.cxx index d98f1ac7ee1e..cbf30eba603d 100644 --- a/sc/source/ui/vba/excelvbahelper.cxx +++ b/sc/source/ui/vba/excelvbahelper.cxx @@ -66,36 +66,33 @@ GetDataBaseRanges( ScDocShell* pShell ) throw ( uno::RuntimeException ) return xDBRanges; } +uno::Reference< sheet::XUnnamedDatabaseRanges > +GetUnnamedDataBaseRanges( ScDocShell* pShell ) throw ( uno::RuntimeException ) +{ + uno::Reference< frame::XModel > xModel; + if ( pShell ) + xModel.set( pShell->GetModel(), uno::UNO_QUERY_THROW ); + uno::Reference< beans::XPropertySet > xModelProps( xModel, uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XUnnamedDatabaseRanges > xUnnamedDBRanges( xModelProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("UnnamedDatabaseRanges") ) ), uno::UNO_QUERY_THROW ); + return xUnnamedDBRanges; +} + // returns the XDatabaseRange for the autofilter on sheet (nSheet) // also populates sName with the name of range uno::Reference< sheet::XDatabaseRange > -GetAutoFiltRange( ScDocShell* pShell, sal_Int16 nSheet, rtl::OUString& sName ) throw ( uno::RuntimeException ) +GetAutoFiltRange( ScDocShell* pShell, sal_Int16 nSheet ) throw ( uno::RuntimeException ) { - uno::Reference< container::XIndexAccess > xIndexAccess( GetDataBaseRanges( pShell ), uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XUnnamedDatabaseRanges > xUnnamedDBRanges( GetUnnamedDataBaseRanges( pShell ), uno::UNO_QUERY_THROW ); uno::Reference< sheet::XDatabaseRange > xDataBaseRange; - table::CellRangeAddress dbAddress; - for ( sal_Int32 index=0; index < xIndexAccess->getCount(); ++index ) + if (xUnnamedDBRanges->hasByTable( nSheet ) ) { - uno::Reference< sheet::XDatabaseRange > xDBRange( xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW ); - uno::Reference< container::XNamed > xNamed( xDBRange, uno::UNO_QUERY_THROW ); - // autofilters work weirdly with openoffice, unnamed is the default - // named range which is used to create an autofilter, but - // its also possible that another name could be used - // this also causes problems when an autofilter is created on - // another sheet - // ( but.. you can use any named range ) - dbAddress = xDBRange->getDataArea(); - if ( dbAddress.Sheet == nSheet ) + uno::Reference< sheet::XDatabaseRange > xDBRange( xUnnamedDBRanges->getByTable( nSheet ) , uno::UNO_QUERY_THROW ); + sal_Bool bHasAuto = false; + uno::Reference< beans::XPropertySet > xProps( xDBRange, uno::UNO_QUERY_THROW ); + xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AutoFilter") ) ) >>= bHasAuto; + if ( bHasAuto ) { - sal_Bool bHasAuto = false; - uno::Reference< beans::XPropertySet > xProps( xDBRange, uno::UNO_QUERY_THROW ); - xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AutoFilter") ) ) >>= bHasAuto; - if ( bHasAuto ) - { - sName = xNamed->getName(); - xDataBaseRange=xDBRange; - break; - } + xDataBaseRange=xDBRange; } } return xDataBaseRange; diff --git a/sc/source/ui/vba/excelvbahelper.hxx b/sc/source/ui/vba/excelvbahelper.hxx index 9befc1548357..1cc0546a4fd7 100644 --- a/sc/source/ui/vba/excelvbahelper.hxx +++ b/sc/source/ui/vba/excelvbahelper.hxx @@ -32,6 +32,7 @@ #include "docsh.hxx" #include #include +#include #include #include #include @@ -65,8 +66,9 @@ formula::FormulaGrammar::Grammar GetFormulaGrammar( ScDocument* pDoc, const ScAd void CompileExcelFormulaToODF( ScDocument* pDoc, const String& rOldFormula, String& rNewFormula ); void CompileODFFormulaToExcel( ScDocument* pDoc, const String& rOldFormula, String& rNewFormula, const formula::FormulaGrammar::Grammar eGrammar ); css::uno::Reference< css::sheet::XDatabaseRanges > GetDataBaseRanges( ScDocShell* pShell ) throw ( css::uno::RuntimeException ); +css::uno::Reference< css::sheet::XUnnamedDatabaseRanges > GetUnnamedDataBaseRanges( ScDocShell* pShell ) throw ( css::uno::RuntimeException ); -css::uno::Reference< css::sheet::XDatabaseRange > GetAutoFiltRange( ScDocShell* pShell, sal_Int16 nSheet, rtl::OUString& sName ) throw ( css::uno::RuntimeException ); +css::uno::Reference< css::sheet::XDatabaseRange > GetAutoFiltRange( ScDocShell* pShell, sal_Int16 nSheet ) throw ( css::uno::RuntimeException ); css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::sheet::XSpreadsheet >& xSheet ) throw ( css::uno::RuntimeException ); css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::sheet::XSheetCellRangeContainer >& xRanges ) throw ( css::uno::RuntimeException ); css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::table::XCellRange >& xRange ) throw ( css::uno::RuntimeException ); diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index df750a774ad4..9c199423abd0 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -4334,20 +4335,10 @@ ScVbaRange::ApplicationRange( const uno::Reference< uno::XComponentContext >& xC // Helper functions for AutoFilter ScDBData* lcl_GetDBData_Impl( ScDocShell* pDocShell, sal_Int16 nSheet ) { - rtl::OUString sName; - excel::GetAutoFiltRange( pDocShell, nSheet, sName ); - OSL_TRACE("lcl_GetDBData_Impl got autofilter range %s for sheet %d", - rtl::OUStringToOString( sName, RTL_TEXTENCODING_UTF8 ).getStr() , nSheet ); ScDBData* pRet = NULL; if (pDocShell) { - ScDBCollection* pNames = pDocShell->GetDocument()->GetDBCollection(); - if (pNames) - { - sal_uInt16 nPos = 0; - if (pNames->SearchName( sName , nPos )) - pRet = (*pNames)[nPos]; - } + pRet = pDocShell->GetDocument()->GetAnonymousDBData(nSheet); } return pRet; } @@ -4501,8 +4492,7 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const sal_Int16 nSheet = thisAddress.Sheet; ScDocShell* pShell = getScDocShell(); sal_Bool bHasAuto = false; - rtl::OUString sAutofiltRangeName; - uno::Reference< sheet::XDatabaseRange > xDataBaseRange = excel::GetAutoFiltRange( pShell, nSheet, sAutofiltRangeName ); + uno::Reference< sheet::XDatabaseRange > xDataBaseRange = excel::GetAutoFiltRange( pShell, nSheet ); if ( xDataBaseRange.is() ) bHasAuto = true; @@ -4549,16 +4539,13 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const } } - uno::Reference< sheet::XDatabaseRanges > xDBRanges = excel::GetDataBaseRanges( pShell ); + uno::Reference< sheet::XUnnamedDatabaseRanges > xDBRanges = excel::GetUnnamedDataBaseRanges( pShell ); if ( xDBRanges.is() ) { - rtl::OUString sGenName( RTL_CONSTASCII_USTRINGPARAM("VBA_Autofilter_") ); - sGenName += rtl::OUString::valueOf( static_cast< sal_Int32 >( nSheet ) ); - OSL_TRACE("Going to add new autofilter range.. name %s", - rtl::OUStringToOString( sGenName, RTL_TEXTENCODING_UTF8 ).getStr() , nSheet ); - if ( !xDBRanges->hasByName( sGenName ) ) - xDBRanges->addNewByName( sGenName, autoFiltAddress ); - xDataBaseRange.set( xDBRanges->getByName( sGenName ), uno::UNO_QUERY_THROW ); + OSL_TRACE("Going to add new autofilter range.. sheet %i", nSheet ); + if ( !xDBRanges->hasByTable( nSheet ) ) + xDBRanges->setByTable( autoFiltAddress ); + xDataBaseRange.set( xDBRanges->getByTable(nSheet ), uno::UNO_QUERY_THROW ); } if ( !xDataBaseRange.is() ) throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Failed to find the autofilter placeholder range" ) ), uno::Reference< uno::XInterface >() ); -- cgit v1.2.3 From 5c5172d1fd30e496203d16a927a6ab8956dd2462 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Mon, 9 May 2011 21:43:31 +0100 Subject: fix crash with out of bound accelerater vector access fdo#36802 --- vcl/source/window/accel.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx index 50d288b71686..837fa60d1e1e 100644 --- a/vcl/source/window/accel.cxx +++ b/vcl/source/window/accel.cxx @@ -118,7 +118,9 @@ static void ImplAccelEntryInsert( ImplAccelList* pList, ImplAccelEntry* pEntry ) do { nIndex++; - ImplAccelEntry* pTempEntry = (*pList)[ nIndex ]; + ImplAccelEntry* pTempEntry = NULL; + if ( nIndex < pList->size() ) + pTempEntry = (*pList)[ nIndex ]; if ( !pTempEntry || (pTempEntry->mnId != pEntry->mnId) ) break; } -- cgit v1.2.3 From a4c34eeb3f849574c2395a57e2ff2a11c78e687f Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 9 May 2011 22:54:59 -0400 Subject: fdo#36933: Fixed array comparison with external references. --- sc/source/core/inc/interpre.hxx | 1 + sc/source/core/tool/interpr1.cxx | 32 ++++++++++++++++++ sc/source/core/tool/interpr4.cxx | 71 +++++++++++++++++++++++++++++++--------- 3 files changed, 88 insertions(+), 16 deletions(-) diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx index ce59c16ffa20..7caee7518f8b 100644 --- a/sc/source/core/inc/interpre.hxx +++ b/sc/source/core/inc/interpre.hxx @@ -316,6 +316,7 @@ void PopExternalSingleRef(ScExternalRefCache::TokenRef& rToken, ScExternalRefCac void PopExternalDoubleRef(sal_uInt16& rFileId, String& rTabName, ScComplexRefData& rRef); void PopExternalDoubleRef(ScExternalRefCache::TokenArrayRef& rArray); void PopExternalDoubleRef(ScMatrixRef& rMat); +void GetExternalDoubleRef(sal_uInt16 nFileId, const String& rTabName, const ScComplexRefData& aData, ScExternalRefCache::TokenArrayRef& rArray); sal_Bool PopDoubleRefOrSingleRef( ScAddress& rAdr ); void PopDoubleRefPushMatrix(); // If MatrixFormula: convert formula::svDoubleRef to svMatrix, create JumpMatrix. diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 41b5e27b2807..c4a8cdd346cd 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -810,6 +810,38 @@ double ScInterpreter::Compare() } } break; + case svExternalSingleRef: + { + ScMatrixRef pMat = GetMatrix(); + if (!pMat) + { + SetError( errIllegalParameter); + break; + } + + SCSIZE nC, nR; + pMat->GetDimensions(nC, nR); + if (!nC || !nR) + { + SetError( errIllegalParameter); + break; + } + if (pMat->IsEmpty(0, 0)) + aComp.bEmpty[i] = true; + else if (pMat->IsString(0, 0)) + { + *aComp.pVal[i] = pMat->GetString(0, 0); + aComp.bVal[i] = false; + } + else + { + aComp.nVal[i] = pMat->GetDouble(0, 0); + aComp.bVal[i] = true; + } + } + break; + case svExternalDoubleRef: + // TODO: Find out how to handle this... default: SetError( errIllegalParameter); break; diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 551a1c2e94ab..bfe5b6b632ac 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -1519,6 +1519,28 @@ void ScInterpreter::PopExternalDoubleRef(ScExternalRefCache::TokenArrayRef& rArr if (nGlobalError) return; + GetExternalDoubleRef(nFileId, aTabName, aData, rArray); + if (nGlobalError) + return; +} + +void ScInterpreter::PopExternalDoubleRef(ScMatrixRef& rMat) +{ + ScExternalRefCache::TokenArrayRef pArray; + PopExternalDoubleRef(pArray); + if (nGlobalError) + return; + + // For now, we only support single range data for external + // references, which means the array should only contain a + // single matrix token. + ScToken* p = static_cast(pArray->First()); + rMat = p->GetMatrix(); +} + +void ScInterpreter::GetExternalDoubleRef( + sal_uInt16 nFileId, const String& rTabName, const ScComplexRefData& rData, ScExternalRefCache::TokenArrayRef& rArray) +{ ScExternalRefManager* pRefMgr = pDok->GetExternalRefManager(); const String* pFile = pRefMgr->getExternalFileName(nFileId); if (!pFile) @@ -1526,18 +1548,19 @@ void ScInterpreter::PopExternalDoubleRef(ScExternalRefCache::TokenArrayRef& rArr SetError(errNoName); return; } - if (aData.Ref1.IsTabRel() || aData.Ref2.IsTabRel()) + if (rData.Ref1.IsTabRel() || rData.Ref2.IsTabRel()) { OSL_FAIL("ScCompiler::GetToken: external double reference must have an absolute table reference!"); SetError(errNoRef); return; } + ScComplexRefData aData(rData); aData.CalcAbsIfRel(aPos); ScRange aRange(aData.Ref1.nCol, aData.Ref1.nRow, aData.Ref1.nTab, aData.Ref2.nCol, aData.Ref2.nRow, aData.Ref2.nTab); ScExternalRefCache::TokenArrayRef pArray = pRefMgr->getDoubleRefTokens( - nFileId, aTabName, aRange, &aPos); + nFileId, rTabName, aRange, &aPos); if (!pArray) { @@ -1562,20 +1585,6 @@ void ScInterpreter::PopExternalDoubleRef(ScExternalRefCache::TokenArrayRef& rArr rArray = pArray; } -void ScInterpreter::PopExternalDoubleRef(ScMatrixRef& rMat) -{ - ScExternalRefCache::TokenArrayRef pArray; - PopExternalDoubleRef(pArray); - if (nGlobalError) - return; - - // For now, we only support single range data for external - // references, which means the array should only contain a - // single matrix token. - ScToken* p = static_cast(pArray->First()); - rMat = p->GetMatrix(); -} - sal_Bool ScInterpreter::PopDoubleRefOrSingleRef( ScAddress& rAdr ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::PopDoubleRefOrSingleRef" ); @@ -1643,6 +1652,7 @@ bool ScInterpreter::ConvertMatrixParameters() case svDouble: case svString: case svSingleRef: + case svExternalSingleRef: case svMissing: case svError: case svEmptyCell: @@ -1700,6 +1710,35 @@ bool ScInterpreter::ConvertMatrixParameters() } } break; + case svExternalDoubleRef: + { + ScParameterClassification::Type eType = + ScParameterClassification::GetParameterType( pCur, nParams - i); + if (eType == ScParameterClassification::Array) + { + sal_uInt16 nFileId = p->GetIndex(); + const String& rTabName = p->GetString(); + const ScComplexRefData& rRef = static_cast(p)->GetDoubleRef(); + ScExternalRefCache::TokenArrayRef pArray; + GetExternalDoubleRef(nFileId, rTabName, rRef, pArray); + if (nGlobalError) + break; + + ScToken* pTemp = static_cast(pArray->First()); + if (!pTemp) + break; + + ScMatrixRef pMat = pTemp->GetMatrix(); + if (pMat) + { + ScToken* pNew = new ScMatrixToken( pMat); + pNew->IncRef(); + pStack[ sp - i ] = pNew; + p->DecRef(); // p may be dead now! + } + } + } + break; case svRefList: { ScParameterClassification::Type eType = -- cgit v1.2.3 From 0bde1500ae0a45c02ab7f99e5f620fd1a29a3274 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Tue, 10 May 2011 12:10:55 +0200 Subject: Clean up MacOS distro config from cruft --- distro-configs/LibreOfficeMacOSX.conf | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/distro-configs/LibreOfficeMacOSX.conf b/distro-configs/LibreOfficeMacOSX.conf index 28f49fa3838c..387b970518db 100644 --- a/distro-configs/LibreOfficeMacOSX.conf +++ b/distro-configs/LibreOfficeMacOSX.conf @@ -1,8 +1,6 @@ --with-vendor=The Document Foundation ---enable-opengl ---enable-hids +--enable-epm --enable-binfilter ---with-fonts --with-java-target-version=1.5 --enable-ext-presenter-minimizer --enable-ext-presenter-console -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 From 17a2f9bf7e52afb0094197de14c658de59f77e83 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Tue, 10 May 2011 16:31:43 +0200 Subject: make it possible to update the region passed to BeginDrawLayers() (bnc#683550) Writer needs this, as it changes the region during painting. --- svx/inc/svx/svdpntv.hxx | 4 ++ svx/source/svdraw/svdpntv.cxx | 106 ++++++++++++++++++++++++++---------------- 2 files changed, 69 insertions(+), 41 deletions(-) diff --git a/svx/inc/svx/svdpntv.hxx b/svx/inc/svx/svdpntv.hxx index 259fe62b720a..e345093bc5f4 100644 --- a/svx/inc/svx/svdpntv.hxx +++ b/svx/inc/svx/svdpntv.hxx @@ -400,6 +400,8 @@ public: // #i74769# Interface change to use common BeginCompleteRedraw/EndCompleteRedraw // #i76114# bDisableIntersect disables intersecting rReg with the Window's paint region SdrPaintWindow* BeginDrawLayers(OutputDevice* pOut, const Region& rReg, bool bDisableIntersect = false); + // used when the region passed to BeginDrawLayers needs to be changed + void UpdateDrawLayersRegion(OutputDevice* pOut, const Region& rReg, bool bDisableIntersect = false); void EndDrawLayers(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer); protected: @@ -412,6 +414,8 @@ protected: // used to paint the form layer after the PreRender device is flushed (painted) to the window. void ImpFormLayerDrawing(SdrPaintWindow& rPaintWindow) const; + Region OptimizeDrawLayersRegion(OutputDevice* pOut, const Region& rReg, bool bDisableIntersect); + public: sal_Bool IsPageVisible() const { return bPageVisible; } // Seite (weisse Flaeche) malen oder nicht sal_Bool IsPageBorderVisible() const { return bPageBorderVisible; } // Seite (weisse Flaeche) malen oder nicht diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx index 3350a33d23c9..a04ab26d949d 100644 --- a/svx/source/svdraw/svdpntv.cxx +++ b/svx/source/svdraw/svdpntv.cxx @@ -964,47 +964,7 @@ SdrPaintWindow* SdrPaintView::BeginDrawLayers(OutputDevice* pOut, const Region& if(pKnownTarget) { - // #i74769# check if pOut is a win and has a ClipRegion. If Yes, the Region - // rReg may be made more granular (fine) with using it. Normally, rReg - // does come from Window::Paint() anyways and thus is based on a single - // rectangle which was derived from exactly that repaint region - Region aOptimizedRepaintRegion(rReg); - - // #i76114# Intersecting the region with the Window's paint region is disabled - // for print preview in Calc, because the intersection can be empty (if the paint - // region is outside of the table area of the page), and then no clip region - // would be set. - if(pOut && OUTDEV_WINDOW == pOut->GetOutDevType() && !bDisableIntersect) - { - Window* pWindow = (Window*)pOut; - - if(pWindow->IsInPaint()) - { - if(!pWindow->GetPaintRegion().IsEmpty()) - { - aOptimizedRepaintRegion.Intersect(pWindow->GetPaintRegion()); - -#ifdef DBG_UTIL - // #i74769# test-paint repaint region - static bool bDoPaintForVisualControl(false); - if(bDoPaintForVisualControl) - { - RegionHandle aRegionHandle(aOptimizedRepaintRegion.BeginEnumRects()); - Rectangle aRegionRectangle; - - while(aOptimizedRepaintRegion.GetEnumRects(aRegionHandle, aRegionRectangle)) - { - pWindow->SetLineColor(COL_LIGHTGREEN); - pWindow->SetFillColor(); - pWindow->DrawRect(aRegionRectangle); - } - - aOptimizedRepaintRegion.EndEnumRects(aRegionHandle); - } -#endif - } - } - } + Region aOptimizedRepaintRegion = OptimizeDrawLayersRegion( pOut, rReg, bDisableIntersect ); // prepare redraw pKnownTarget->PrepareRedraw(aOptimizedRepaintRegion); @@ -1029,6 +989,70 @@ void SdrPaintView::EndDrawLayers(SdrPaintWindow& rPaintWindow, bool bPaintFormLa } } +void SdrPaintView::UpdateDrawLayersRegion(OutputDevice* pOut, const Region& rReg, bool bDisableIntersect) +{ + SdrPaintWindow* pPaintWindow = FindPaintWindow(*pOut); + OSL_ENSURE(pPaintWindow, "SdrPaintView::UpdateDrawLayersRegion: No SdrPaintWindow (!)"); + + if(mpPageView) + { + SdrPageWindow* pKnownTarget = mpPageView->FindPageWindow(*pPaintWindow); + + if(pKnownTarget) + { + Region aOptimizedRepaintRegion = OptimizeDrawLayersRegion( pOut, rReg, bDisableIntersect ); + pKnownTarget->GetPaintWindow().SetRedrawRegion(aOptimizedRepaintRegion); + mpPageView->setPreparedPageWindow(pKnownTarget); // already set actually + } + } +} + +Region SdrPaintView::OptimizeDrawLayersRegion(OutputDevice* pOut, const Region& rReg, bool bDisableIntersect) +{ + // #i74769# check if pOut is a win and has a ClipRegion. If Yes, the Region + // rReg may be made more granular (fine) with using it. Normally, rReg + // does come from Window::Paint() anyways and thus is based on a single + // rectangle which was derived from exactly that repaint region + Region aOptimizedRepaintRegion(rReg); + + // #i76114# Intersecting the region with the Window's paint region is disabled + // for print preview in Calc, because the intersection can be empty (if the paint + // region is outside of the table area of the page), and then no clip region + // would be set. + if(pOut && OUTDEV_WINDOW == pOut->GetOutDevType() && !bDisableIntersect) + { + Window* pWindow = (Window*)pOut; + + if(pWindow->IsInPaint()) + { + if(!pWindow->GetPaintRegion().IsEmpty()) + { + aOptimizedRepaintRegion.Intersect(pWindow->GetPaintRegion()); + +#ifdef DBG_UTIL + // #i74769# test-paint repaint region + static bool bDoPaintForVisualControl(false); + if(bDoPaintForVisualControl) + { + RegionHandle aRegionHandle(aOptimizedRepaintRegion.BeginEnumRects()); + Rectangle aRegionRectangle; + + while(aOptimizedRepaintRegion.GetEnumRects(aRegionHandle, aRegionRectangle)) + { + pWindow->SetLineColor(COL_LIGHTGREEN); + pWindow->SetFillColor(); + pWindow->DrawRect(aRegionRectangle); + } + + aOptimizedRepaintRegion.EndEnumRects(aRegionHandle); + } +#endif + } + } + } + return aOptimizedRepaintRegion; +} + //////////////////////////////////////////////////////////////////////////////////////////////////// void SdrPaintView::ImpTextEditDrawing(SdrPaintWindow& rPaintWindow) const -- cgit v1.2.3 -- cgit v1.2.3 From 26183304e21653cbef2d4a76d2af9c5ead5991bb Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Tue, 10 May 2011 14:02:26 +0100 Subject: revert commit 5d8a59f64d9d3931e2c9c1ba98f57cd10e0b01c1, fix fdo#36340 old commit: 'Convert std::vector to boost::ptr_vector.' this conflated the destruction and removal from list stages which have to be separate, so we do not re-enterancy from control destructors. --- sw/source/ui/inc/swuicnttab.hxx | 37 ++--- sw/source/ui/index/cnttab.cxx | 293 ++++++++++++++++++++++------------------ 2 files changed, 179 insertions(+), 151 deletions(-) diff --git a/sw/source/ui/inc/swuicnttab.hxx b/sw/source/ui/inc/swuicnttab.hxx index 63298235243f..a2ff8e8c0294 100644 --- a/sw/source/ui/inc/swuicnttab.hxx +++ b/sw/source/ui/inc/swuicnttab.hxx @@ -28,25 +28,27 @@ #ifndef _SWUI_CNTTAB_HXX #define _SWUI_CNTTAB_HXX -#include - -#include -#include -#include -#include -#include #include + #include + #include -#include + #include -#include -#include -#include -#include +#include +#include +#include #include "tox.hxx" +#include +#include +#include +#include +#include +#include +#include +#include class SwWrtShell; class SwTOXMgr; @@ -259,16 +261,15 @@ class SwTOXEntryTabPage; class SwTokenWindow : public Window { - typedef boost::ptr_vector TOXControlList; - typedef TOXControlList::iterator ctrl_iterator; - typedef TOXControlList::const_iterator ctrl_const_iterator; - typedef TOXControlList::reverse_iterator ctrl_reverse_iterator; - typedef TOXControlList::const_reverse_iterator ctrl_const_reverse_iterator; + typedef std::vector::iterator ctrl_iterator; + typedef std::vector::const_iterator ctrl_const_iterator; + typedef std::vector::reverse_iterator ctrl_reverse_iterator; + typedef std::vector::const_reverse_iterator ctrl_const_reverse_iterator; ImageButton aLeftScrollWin; Window aCtrlParentWin; ImageButton aRightScrollWin; - TOXControlList aControlList; + std::vector aControlList; SwForm* pForm; sal_uInt16 nLevel; sal_Bool bValid; diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 5ae40724d85b..4fc60b300dfb 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -111,17 +111,6 @@ static const sal_Unicode aDeliEnd = ']'; //fuer die form #define IDX_FILE_EXTENSION String::CreateFromAscii( \ RTL_CONSTASCII_STRINGPARAM( "*.sdi" )) -static boost::ptr_vector::iterator FindControl (boost::ptr_vector &list, Control *ctrl) -{ - for (boost::ptr_vector::iterator it = list.begin(); it != list.end(); ++it) - { - if ((&(*it)) == ctrl) - return it; - } - - return list.end(); -} - String lcl_CreateAutoMarkFileDlg( const String& rURL, const String& rFileString, sal_Bool bOpen ) { @@ -2879,6 +2868,13 @@ SwTokenWindow::SwTokenWindow(SwTOXEntryTabPage* pParent, const ResId& rResId) : SwTokenWindow::~SwTokenWindow() { + for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it) + { + Control* pControl = (*it); + pControl->SetGetFocusHdl( Link() ); + pControl->SetLoseFocusHdl( Link() ); + delete pControl; + } } void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL) @@ -2886,9 +2882,14 @@ void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL) SetActiveControl(0); bValid = sal_True; - //apply current level settings to the form if(pForm) + { + //apply current level settings to the form + for (ctrl_iterator iter = aControlList.begin(); iter != aControlList.end(); ++iter) + delete (*iter); + aControlList.clear(); + } nLevel = nL; pForm = &rForm; @@ -2986,17 +2987,17 @@ Control* SwTokenWindow::InsertItem(const String& rText, const SwFormToken& rT Point aControlPos; if(!aControlList.empty()) - { - ctrl_const_reverse_iterator iterLast = aControlList.rbegin(); + { + Control* pLast = *(aControlList.rbegin()); - aControlSize = iterLast->GetSizePixel(); - aControlPos = iterLast->GetPosPixel(); + aControlSize = pLast->GetSizePixel(); + aControlPos = pLast->GetPosPixel(); aControlPos.X() += aControlSize.Width(); } if(TOKEN_TEXT == rToken.eTokenType) { - SwTOXEdit *pEdit = new SwTOXEdit(&aCtrlParentWin, this, rToken); + SwTOXEdit* pEdit = new SwTOXEdit(&aCtrlParentWin, this, rToken); pEdit->SetPosPixel(aControlPos); aControlList.push_back(pEdit); @@ -3063,73 +3064,71 @@ void SwTokenWindow::InsertAtSelection( // LS // LE // - bool bPreStartLinkFound = false; - bool bPreEndLinkFound = false; + sal_Bool bPreStartLinkFound = sal_False; + sal_Bool bPreEndLinkFound = sal_False; - const Control *pExchange = 0; - ctrl_const_iterator it = aControlList.begin(); + const Control* pControl = 0; + const Control* pExchange = 0; - while ( it != aControlList.end()) + ctrl_const_iterator it = aControlList.begin(); + for( ; it != aControlList.end() && pActiveCtrl != (*it); ++it ) { - if ((&(*it)) == pActiveCtrl) - break; + pControl = *it; - if( WINDOW_EDIT != it->GetType()) + if( WINDOW_EDIT != pControl->GetType()) { const SwFormToken& rNewToken = - (reinterpret_cast(*it)).GetFormToken(); + ((SwTOXButton*)pControl)->GetFormToken(); if( TOKEN_LINK_START == rNewToken.eTokenType ) { - bPreStartLinkFound = true; + bPreStartLinkFound = sal_True; pExchange = 0; } else if(TOKEN_LINK_END == rNewToken.eTokenType) { if( bPreStartLinkFound ) - bPreStartLinkFound = false; + bPreStartLinkFound = sal_False; else { - bPreEndLinkFound = false; - pExchange = const_cast(&(*it)); + bPreEndLinkFound = sal_False; + pExchange = pControl; } } } - - ++it; } bool bPostLinkStartFound = false; if(!bPreStartLinkFound && !bPreEndLinkFound) { - while(it != aControlList.end()) + for( ; it != aControlList.end(); ++it ) { - if( (&(*it)) != pActiveCtrl && - WINDOW_EDIT != it->GetType()) + pControl = *it; + + if( pControl != pActiveCtrl && + WINDOW_EDIT != pControl->GetType()) { const SwFormToken& rNewToken = - reinterpret_cast(*it).GetFormToken(); + ((SwTOXButton*)pControl)->GetFormToken(); if( TOKEN_LINK_START == rNewToken.eTokenType ) { if(bPostLinkStartFound) break; - bPostLinkStartFound = true; - pExchange = const_cast(&(*it)); + bPostLinkStartFound = sal_True; + pExchange = pControl; } else if(TOKEN_LINK_END == rNewToken.eTokenType ) { if(bPostLinkStartFound) { - bPostLinkStartFound = false; + bPostLinkStartFound = sal_False; pExchange = 0; } break; } } - - ++it; } } @@ -3142,7 +3141,6 @@ void SwTokenWindow::InsertAtSelection( if(bPostLinkStartFound) { OSL_ENSURE(pExchange, "no control to exchange?"); - if(pExchange) { ((SwTOXButton*)pExchange)->SetLinkEnd(); @@ -3164,7 +3162,9 @@ void SwTokenWindow::InsertAtSelection( //if the active control is text then insert a new button at the selection //else replace the button - ctrl_iterator iterActive = FindControl(aControlList,pActiveCtrl); + ctrl_iterator iterActive = std::find(aControlList.begin(), + aControlList.end(), pActiveCtrl); + ctrl_iterator iterInsert = iterActive; Size aControlSize(GetOutputSizePixel()); @@ -3187,7 +3187,7 @@ void SwTokenWindow::InsertAtSelection( SwFormToken aTmpToken(TOKEN_TEXT); SwTOXEdit* pEdit = new SwTOXEdit(&aCtrlParentWin, this, aTmpToken); - aControlList.insert(iterInsert,pEdit); + aControlList.insert(iterInsert, pEdit); pEdit->SetText(sRight); pEdit->SetSizePixel(aControlSize); @@ -3199,13 +3199,15 @@ void SwTokenWindow::InsertAtSelection( } else { - pActiveCtrl->Hide(); aControlList.erase(iterActive); + pActiveCtrl->Hide(); + delete pActiveCtrl; } //now the new button SwTOXButton* pButton = new SwTOXButton(&aCtrlParentWin, this, aToInsertToken); - aControlList.insert(iterInsert,pButton); + + aControlList.insert(iterInsert, pButton); pButton->SetPrevNextLink(LINK(this, SwTokenWindow, NextItemBtnHdl)); pButton->SetGetFocusHdl(LINK(this, SwTokenWindow, TbxFocusBtnHdl)); @@ -3237,7 +3239,7 @@ void SwTokenWindow::RemoveControl(SwTOXButton* pDel, sal_Bool bInternalCall ) if(bInternalCall && TOX_AUTHORITIES == pForm->GetTOXType()) m_pParent->PreTokenButtonRemoved(pDel->GetFormToken()); - ctrl_iterator it = FindControl(aControlList,pDel); + ctrl_iterator it = std::find(aControlList.begin(), aControlList.end(), pDel); OSL_ENSURE(it != aControlList.end(), "Control does not exist!"); @@ -3246,22 +3248,26 @@ void SwTokenWindow::RemoveControl(SwTOXButton* pDel, sal_Bool bInternalCall ) OSL_ENSURE(it != aControlList.begin() && it != aControlList.end() - 1, "Button at first or last position?"); - Control *pLeftCtrl = const_cast(&(*(it-1))); - Control *pRightCtrl = const_cast(&(*(it+1))); + ctrl_iterator itLeft = it, itRight = it; + --itLeft; + ++itRight; + Control *pLeftEdit = *itLeft; + Control *pRightEdit = *itRight; - String sTemp(((SwTOXEdit*)pLeftCtrl)->GetText()); - sTemp += ((SwTOXEdit*)pRightCtrl)->GetText(); - ((SwTOXEdit*)pLeftCtrl)->SetText(sTemp); - ((SwTOXEdit*)pLeftCtrl)->AdjustSize(); + String sTemp(((SwTOXEdit*)pLeftEdit)->GetText()); + sTemp += ((SwTOXEdit*)pRightEdit)->GetText(); + ((SwTOXEdit*)pLeftEdit)->SetText(sTemp); + ((SwTOXEdit*)pLeftEdit)->AdjustSize(); - aControlList.erase(it+1); - aControlList.erase(it); + aControlList.erase(itRight); + delete pRightEdit; + aControlList.erase(it); pActiveCtrl->Hide(); + delete pActiveCtrl; - SetActiveControl(pLeftCtrl); + SetActiveControl(pLeftEdit); AdjustPositions(); - if(aModifyHdl.IsSet()) aModifyHdl.Call(0); } @@ -3271,14 +3277,17 @@ void SwTokenWindow::AdjustPositions() if(aControlList.size() > 1) { ctrl_iterator it = aControlList.begin(); + Control* pCtrl = *it; + ++it; - Point aNextPos = it->GetPosPixel(); - aNextPos.X() += it->GetSizePixel().Width(); + Point aNextPos = pCtrl->GetPosPixel(); + aNextPos.X() += pCtrl->GetSizePixel().Width(); - for (++it; it != aControlList.end(); ++it) - { - it->SetPosPixel(aNextPos); - aNextPos.X() += it->GetSizePixel().Width(); + for(; it != aControlList.end(); ++it) + { + pCtrl = *it; + pCtrl->SetPosPixel(aNextPos); + aNextPos.X() += pCtrl->GetSizePixel().Width(); } AdjustScrolling(); @@ -3290,10 +3299,12 @@ void SwTokenWindow::MoveControls(long nOffset) // move the complete list for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { - Point aPos = it->GetPosPixel(); + Control *pCtrl = *it; + + Point aPos = pCtrl->GetPosPixel(); aPos.X() += nOffset; - it->SetPosPixel(aPos); + pCtrl->SetPosPixel(aPos); } } @@ -3302,19 +3313,21 @@ void SwTokenWindow::AdjustScrolling() if(aControlList.size() > 1) { //validate scroll buttons - ctrl_const_reverse_iterator iterLast = aControlList.rbegin(); - ctrl_const_iterator iterFirst = aControlList.begin(); + Control* pFirstCtrl = *(aControlList.begin()); + Control* pLastCtrl = *(aControlList.rbegin()); long nSpace = aCtrlParentWin.GetSizePixel().Width(); - long nWidth = iterLast->GetPosPixel().X() - iterFirst->GetPosPixel().X() - + iterLast->GetSizePixel().Width(); + long nWidth = pLastCtrl->GetPosPixel().X() - pFirstCtrl->GetPosPixel().X() + + pLastCtrl->GetSizePixel().Width(); bool bEnable = nWidth > nSpace; + //the active control must be visible if(bEnable && pActiveCtrl) { - long nMove = 0; Point aActivePos(pActiveCtrl->GetPosPixel()); + long nMove = 0; + if(aActivePos.X() < 0) nMove = -aActivePos.X(); else if((aActivePos.X() + pActiveCtrl->GetSizePixel().Width()) > nSpace) @@ -3323,16 +3336,20 @@ void SwTokenWindow::AdjustScrolling() if(nMove) MoveControls(nMove); - aLeftScrollWin.Enable(iterFirst->GetPosPixel().X() < 0); - aRightScrollWin.Enable((iterLast->GetPosPixel().X() + iterLast->GetSizePixel().Width()) > nSpace); + aLeftScrollWin.Enable(pFirstCtrl->GetPosPixel().X() < 0); + + aRightScrollWin.Enable((pLastCtrl->GetPosPixel().X() + pLastCtrl->GetSizePixel().Width()) > nSpace); } else { - //if the control fits into the space then the first control must be at postion 0 - long nFirstPos = iterFirst->GetPosPixel().X(); + if(pFirstCtrl) + { + //if the control fits into the space then the first control must be at postion 0 + long nFirstPos = pFirstCtrl->GetPosPixel().X(); - if(nFirstPos != 0) - MoveControls(-nFirstPos); + if(nFirstPos != 0) + MoveControls(-nFirstPos); + } aRightScrollWin.Enable(false); aLeftScrollWin.Enable(false); @@ -3346,7 +3363,6 @@ IMPL_LINK(SwTokenWindow, ScrollHdl, ImageButton*, pBtn ) return 0; const long nSpace = aCtrlParentWin.GetSizePixel().Width(); - #if OSL_DEBUG_LEVEL > 1 //find all start/end positions and print it String sMessage(String::CreateFromAscii("Space: ")); @@ -3355,8 +3371,10 @@ IMPL_LINK(SwTokenWindow, ScrollHdl, ImageButton*, pBtn ) for (ctrl_const_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { - long nDebugXPos = it->GetPosPixel().X(); - long nDebugWidth = it->GetSizePixel().Width(); + Control *pDebugCtrl = *it; + + long nDebugXPos = pDebugCtrl->GetPosPixel().X(); + long nDebugWidth = pDebugCtrl->GetSizePixel().Width(); sMessage += String::CreateFromInt32( nDebugXPos ); sMessage += String::CreateFromAscii(" "); @@ -3372,11 +3390,13 @@ IMPL_LINK(SwTokenWindow, ScrollHdl, ImageButton*, pBtn ) //find the first completely visible control (left edge visible) for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { - long nXPos = it->GetPosPixel().X(); + Control *pCtrl = *it; + + long nXPos = pCtrl->GetPosPixel().X(); if (nXPos >= 0) { - if(it == aControlList.begin()) + if (it == aControlList.begin()) { //move the current control to the left edge nMove = -nXPos; @@ -3384,8 +3404,11 @@ IMPL_LINK(SwTokenWindow, ScrollHdl, ImageButton*, pBtn ) else { //move the left neighbor to the start position - ctrl_iterator iterLeft = it-1; - nMove = -iterLeft->GetPosPixel().X(); + ctrl_iterator itLeft = it; + --itLeft; + Control *pLeft = *itLeft; + + nMove = -pLeft->GetPosPixel().X(); } break; @@ -3397,16 +3420,20 @@ IMPL_LINK(SwTokenWindow, ScrollHdl, ImageButton*, pBtn ) //find the first completely visible control (right edge visible) for (ctrl_reverse_iterator it = aControlList.rbegin(); it != aControlList.rend(); ++it) { - long nCtrlWidth = it->GetSizePixel().Width(); - long nXPos = it->GetPosPixel().X() + nCtrlWidth; + Control *pCtrl = *it; + + long nCtrlWidth = pCtrl->GetSizePixel().Width(); + long nXPos = pCtrl->GetPosPixel().X() + nCtrlWidth; if (nXPos <= nSpace) { if (it != aControlList.rbegin()) { //move the right neighbor to the right edge right aligned - ctrl_reverse_iterator iterRight = it-1; - nMove = nSpace - iterRight->GetPosPixel().X() - iterRight->GetSizePixel().Width(); + ctrl_reverse_iterator itRight = it; + --it; + Control *pRight = *itRight; + nMove = nSpace - pRight->GetPosPixel().X() - pRight->GetSizePixel().Width(); } break; @@ -3419,20 +3446,23 @@ IMPL_LINK(SwTokenWindow, ScrollHdl, ImageButton*, pBtn ) if(nMove) { // move the complete list + + Control *pCtrl = 0; + for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { - Point aPos = it->GetPosPixel(); + pCtrl = *it; + Point aPos = pCtrl->GetPosPixel(); aPos.X() += nMove; - - it->SetPosPixel(aPos); + pCtrl->SetPosPixel(aPos); } - ctrl_iterator iterCtrl = aControlList.begin(); - aLeftScrollWin.Enable(iterCtrl->GetPosPixel().X() < 0); + pCtrl = *(aControlList.begin()); + aLeftScrollWin.Enable(pCtrl->GetPosPixel().X() < 0); - iterCtrl = aControlList.end()-1; - aRightScrollWin.Enable((iterCtrl->GetPosPixel().X() + iterCtrl->GetSizePixel().Width()) > nSpace); + pCtrl = *(aControlList.rbegin()); + aRightScrollWin.Enable((pCtrl->GetPosPixel().X() + pCtrl->GetSizePixel().Width()) > nSpace); #if OSL_DEBUG_LEVEL > 1 sMessage.AppendAscii("Move: "); @@ -3447,14 +3477,14 @@ IMPL_LINK(SwTokenWindow, ScrollHdl, ImageButton*, pBtn ) String SwTokenWindow::GetPattern() const { String sRet; - const Control *ctrl = 0; + for (ctrl_const_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { - ctrl = &(*it); + const Control *pCtrl = *it; - const SwFormToken& rNewToken = WINDOW_EDIT == ctrl->GetType() - ? ((SwTOXEdit*)ctrl)->GetFormToken() - : ((SwTOXButton*)ctrl)->GetFormToken(); + const SwFormToken &rNewToken = pCtrl->GetType() == WINDOW_EDIT + ? ((SwTOXEdit*)pCtrl)->GetFormToken() + : ((SwTOXButton*)pCtrl)->GetFormToken(); //TODO: prevent input of TOX_STYLE_DELIMITER in KeyInput sRet += rNewToken.GetString(); @@ -3469,15 +3499,14 @@ String SwTokenWindow::GetPattern() const sal_Bool SwTokenWindow::Contains(FormTokenType eSearchFor) const { bool bRet = false; - const Control* pControl = 0; for (ctrl_const_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { - pControl = &(*it); + const Control *pCtrl = *it; - const SwFormToken& rNewToken = WINDOW_EDIT == pControl->GetType() - ? ((SwTOXEdit*)pControl)->GetFormToken() - : ((SwTOXButton*)pControl)->GetFormToken(); + const SwFormToken &rNewToken = pCtrl->GetType() == WINDOW_EDIT + ? ((SwTOXEdit*)pCtrl)->GetFormToken() + : ((SwTOXButton*)pCtrl)->GetFormToken(); if (eSearchFor == rNewToken.eTokenType) { @@ -3563,24 +3592,22 @@ IMPL_LINK(SwTokenWindow, EditResize, Edit*, pEdit) IMPL_LINK(SwTokenWindow, NextItemHdl, SwTOXEdit*, pEdit) { - ctrl_iterator it = FindControl(aControlList,pEdit); + ctrl_iterator it = std::find(aControlList.begin(),aControlList.end(),pEdit); if (it == aControlList.end()) return 0; - ctrl_iterator lastIter = aControlList.end()-1; + ctrl_iterator itTest = it; + ++itTest; if ((it != aControlList.begin() && !pEdit->IsNextControl()) || - (it != lastIter && pEdit->IsNextControl())) + (itTest != aControlList.end() && pEdit->IsNextControl())) { ctrl_iterator iterFocus = it; - pEdit->IsNextControl() ? ++iterFocus : --iterFocus; - Control *pCtrlFocus = &(*iterFocus); - + Control *pCtrlFocus = *iterFocus; pCtrlFocus->GrabFocus(); - reinterpret_cast(pCtrlFocus)->Check(); AdjustScrolling(); @@ -3593,7 +3620,7 @@ IMPL_LINK(SwTokenWindow, TbxFocusHdl, SwTOXEdit*, pEdit) { for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { - Control *pCtrl = &(*it); + Control *pCtrl = *it; if (pCtrl && pCtrl->GetType() != WINDOW_EDIT) reinterpret_cast(pCtrl)->Check(false); @@ -3606,31 +3633,29 @@ IMPL_LINK(SwTokenWindow, TbxFocusHdl, SwTOXEdit*, pEdit) IMPL_LINK(SwTokenWindow, NextItemBtnHdl, SwTOXButton*, pBtn ) { - ctrl_iterator iter = FindControl(aControlList,pBtn); + ctrl_iterator it = std::find(aControlList.begin(),aControlList.end(),pBtn); - if (iter == aControlList.end()) + if (it == aControlList.end()) return 0; - ctrl_iterator lastIter = aControlList.end()-1; + ctrl_iterator itTest = it; + ++itTest; - if((iter != aControlList.begin() && !pBtn->IsNextControl()) || - (iter != lastIter && pBtn->IsNextControl())) + if (!pBtn->IsNextControl() || (itTest != aControlList.end() && pBtn->IsNextControl())) { - bool bNext = pBtn->IsNextControl(); - - ctrl_iterator iterFocus = iter; + bool isNext = pBtn->IsNextControl(); - bNext ? ++iterFocus : --iterFocus; - - Control *pCtrlFocus = &(*iterFocus); + ctrl_iterator iterFocus = it; + isNext ? ++iterFocus : --iterFocus; + Control *pCtrlFocus = *iterFocus; pCtrlFocus->GrabFocus(); - Selection aSel(0,0); - if(!bNext) + if (!isNext) { - sal_uInt16 nLen = ((SwTOXEdit*)pCtrlFocus)->GetText().Len(); + sal_uInt16 nLen = reinterpret_cast(pCtrlFocus)->GetText().Len(); + aSel.A() = nLen; aSel.B() = nLen; } @@ -3647,10 +3672,9 @@ IMPL_LINK(SwTokenWindow, NextItemBtnHdl, SwTOXButton*, pBtn ) IMPL_LINK(SwTokenWindow, TbxFocusBtnHdl, SwTOXButton*, pBtn ) { - Control *pControl = 0; - for (ctrl_iterator sit = aControlList.begin(); sit != aControlList.end(); ++sit) + for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { - pControl = &(*sit); + Control *pControl = *it; if (pControl && WINDOW_EDIT != pControl->GetType()) reinterpret_cast(pControl)->Check(pBtn == pControl); @@ -3667,11 +3691,14 @@ void SwTokenWindow::GetFocus() { if (!aControlList.empty()) { - Control *pFirst = &(*aControlList.begin()); + Control *pFirst = *aControlList.begin(); - pFirst->GrabFocus(); - SetActiveControl(pFirst); - AdjustScrolling(); + if (pFirst) + { + pFirst->GrabFocus(); + SetActiveControl(pFirst); + AdjustScrolling(); + } } } } -- cgit v1.2.3 From efb0af446f3203c802fd92a2246eac1b1d5bc2c9 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Tue, 10 May 2011 16:33:13 +0200 Subject: update SdrPaintView's region when it changes in writer (bnc#683550) ViewShell::DLPrePaint2() gets a region as an argument, but uses it only during the first call, following calls only increment the lock counter, so if the region changes, the change doesn't take effect, causing redraw problems. So the fix is the replace the lock counter with a stack of used regions and update the region as appropriate. --- sw/inc/viewsh.hxx | 5 +++-- sw/source/core/view/viewsh.cxx | 28 +++++++++++++++++++++------- sw/source/core/view/vnew.cxx | 2 -- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 27f4d434df44..006895099bd1 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -37,6 +37,7 @@ #include #include #include // swmod 080115 +#include #include #include @@ -236,7 +237,7 @@ public: ////////////////////////////////////////////////////////////////////////////// // #i72754# set of Pre/PostPaints with lock counter and initial target OutDev protected: - sal_uInt32 mnPrePostPaintCount; + std::stack mPrePostPaintRegions; // acts also as a lock counter (empty == not locked) OutputDevice* mpPrePostOutDev; MapMode maPrePostMapMode; public: @@ -248,7 +249,7 @@ public: virtual void Paint(const Rectangle &rRect); sal_Bool IsPaintInProgress() const { return bPaintInProgress; } - bool IsDrawingLayerPaintInProgress() const { return 0 != mnPrePostPaintCount; } + bool IsDrawingLayerPaintInProgress() const { return !mPrePostPaintRegions.empty(); } //Benachrichtung, dass sich der sichtbare Bereich geaendert hat. //VisArea wird neu gesetzt, anschliessend wird gescrollt. diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 797ed01a3287..e328e369e696 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -98,7 +98,7 @@ using namespace ::com::sun::star; ////////////////////////////////////////////////////////////////////////////// // #i72754# 2nd set of Pre/PostPaints -// This time it uses the lock counter mnPrePostPaintCount to allow only one activation +// This time it uses the lock counter (mPrePostPaintRegions empty/non-empty) to allow only one activation // and deactivation and mpPrePostOutDev to remember the OutDev from the BeginDrawLayers // call. That way, all places where paint take place can be handled the same way, even // when calling other paint methods. This is the case at the places where SW paints @@ -116,8 +116,9 @@ void ViewShell::PrePaint() void ViewShell::DLPrePaint2(const Region& rRegion) { - if(0L == mnPrePostPaintCount) + if(mPrePostPaintRegions.empty()) { + mPrePostPaintRegions.push( rRegion ); // #i75172# ensure DrawView to use DrawingLayer bufferings if ( !HasDrawView() ) MakeDrawView(); @@ -139,16 +140,29 @@ void ViewShell::DLPrePaint2(const Region& rRegion) // remember original paint MapMode for wrapped FlyFrame paints maPrePostMapMode = pOut->GetMapMode(); } - - mnPrePostPaintCount++; + else + { + // region needs to be updated to the given one + if( mPrePostPaintRegions.top() != rRegion ) + Imp()->GetDrawView()->UpdateDrawLayersRegion(mpPrePostOutDev, rRegion); + mPrePostPaintRegions.push( rRegion ); + } } void ViewShell::DLPostPaint2(bool bPaintFormLayer) { - OSL_ENSURE(mnPrePostPaintCount > 0L, "ViewShell::DLPostPaint2: Pre/PostPaint encapsulation broken (!)"); - mnPrePostPaintCount--; + OSL_ENSURE(!mPrePostPaintRegions.empty(), "ViewShell::DLPostPaint2: Pre/PostPaint encapsulation broken (!)"); - if((0L == mnPrePostPaintCount) && (0 != mpTargetPaintWindow)) + if( mPrePostPaintRegions.size() > 1 ) + { + Region current = mPrePostPaintRegions.top(); + mPrePostPaintRegions.pop(); + if( current != mPrePostPaintRegions.top()) + Imp()->GetDrawView()->UpdateDrawLayersRegion(mpPrePostOutDev, mPrePostPaintRegions.top()); + return; + } + mPrePostPaintRegions.pop(); // clear + if(0 != mpTargetPaintWindow) { // #i74769# restore buffered OutDev if(mpTargetPaintWindow->GetPreRenderDevice()) diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx index 668a9028d36a..7b51f53b9df3 100644 --- a/sw/source/core/view/vnew.cxx +++ b/sw/source/core/view/vnew.cxx @@ -158,7 +158,6 @@ ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow, pDoc( &rDocument ), nStartAction( 0 ), nLockPaint( 0 ), - mnPrePostPaintCount(0L), mpPrePostOutDev(0), maPrePostMapMode() { @@ -226,7 +225,6 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow, pDoc( rShell.GetDoc() ), nStartAction( 0 ), nLockPaint( 0 ), - mnPrePostPaintCount(0L), mpPrePostOutDev(0), maPrePostMapMode() { -- cgit v1.2.3 From 49eaf3b867ce7853f4c24040592ba8eddcc9e137 Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Tue, 10 May 2011 19:37:31 +0200 Subject: use build id for the release number also for deb packages I have just realised that deb packages used milestone as the release number; it is bumped only when we merge changes from OOo; so, we should use the build id that is used as the release number for rpms and windows build for a long time --- instsetoo_native/util/openoffice.lst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/instsetoo_native/util/openoffice.lst b/instsetoo_native/util/openoffice.lst index 2e6ef999340e..4383d2ff7dde 100644 --- a/instsetoo_native/util/openoffice.lst +++ b/instsetoo_native/util/openoffice.lst @@ -75,7 +75,7 @@ LibreOffice FILEFORMATVERSION 1.0 WRITERCOMPATIBILITYVERSIONOOO11 OpenOffice.org 1.1 PACKAGEVERSION 3.4.0 - PACKAGEREVISION {milestone} + PACKAGEREVISION {buildid} LICENSENAME LGPL GLOBALFILEGID gid_File_Lib_Vcl GLOBALPATCHFILEGID gid_File_Txt_Patchfiles @@ -142,7 +142,7 @@ LibreOffice_wJRE FILEFORMATVERSION 1.0 WRITERCOMPATIBILITYVERSIONOOO11 OpenOffice.org 1.1 PACKAGEVERSION 3.4.0 - PACKAGEREVISION {milestone} + PACKAGEREVISION {buildid} LICENSENAME LGPL WITHJREPRODUCT 1 GLOBALFILEGID gid_File_Lib_Vcl @@ -212,7 +212,7 @@ LibreOffice_Dev FILEFORMATVERSION 1.0 WRITERCOMPATIBILITYVERSIONOOO11 OpenOffice.org 1.1 PACKAGEVERSION 3.4.0 - PACKAGEREVISION {milestone} + PACKAGEREVISION {buildid} LICENSENAME LGPL GLOBALFILEGID gid_File_Lib_Vcl GLOBALPATCHFILEGID gid_File_Txt_Patchfiles @@ -310,7 +310,7 @@ LibreOffice_SDK POSTVERSIONEXTENSIONUNIX sdk BRANDPACKAGEVERSION 3.4 PACKAGEVERSION 3.4.0 - PACKAGEREVISION {milestone} + PACKAGEREVISION {buildid} PACK_INSTALLED 1 POOLPRODUCT 0 DMG_VOLUMEEXTENSION SDK @@ -358,7 +358,7 @@ LibreOffice_Dev_SDK POSTVERSIONEXTENSIONUNIX sdk BRANDPACKAGEVERSION 3.4 PACKAGEVERSION 3.4.0 - PACKAGEREVISION {milestone} + PACKAGEREVISION {buildid} BASISPACKAGEPREFIX libobasis-dev UREPACKAGEPREFIX lodev SOLSUREPACKAGEPREFIX lodev @@ -421,7 +421,7 @@ OxygenOffice FILEFORMATVERSION 1.0 WRITERCOMPATIBILITYVERSIONOOO11 OpenOffice.org 1.1 PACKAGEVERSION 3.4.0 - PACKAGEREVISION {milestone} + PACKAGEREVISION {buildid} LICENSENAME LGPL SERVICESPROJEKT 1 GLOBALFILEGID gid_File_Lib_Vcl @@ -490,7 +490,7 @@ OxygenOffice_wJRE FILEFORMATVERSION 1.0 WRITERCOMPATIBILITYVERSIONOOO11 OpenOffice.org 1.1 PACKAGEVERSION 3.4.0 - PACKAGEREVISION {milestone} + PACKAGEREVISION {buildid} LICENSENAME LGPL SERVICESPROJEKT 1 WITHJREPRODUCT 1 -- cgit v1.2.3 From 949434f57ea1b2c3d9d15fade9c0730ee3b1dd9f Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Tue, 10 May 2011 18:03:46 +0200 Subject: bump product version to 3.4.0-beta5, release number to 5 --- instsetoo_native/util/openoffice.lst | 16 ++++++++-------- solenv/inc/minor.mk | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/instsetoo_native/util/openoffice.lst b/instsetoo_native/util/openoffice.lst index 4383d2ff7dde..2fb7e97558da 100644 --- a/instsetoo_native/util/openoffice.lst +++ b/instsetoo_native/util/openoffice.lst @@ -57,7 +57,7 @@ LibreOffice PRODUCTVERSION 3.4 PRODUCTEXTENSION LONG_PRODUCTEXTENSION - SHORT_PRODUCTEXTENSION beta4 + SHORT_PRODUCTEXTENSION beta5 POSTVERSIONEXTENSION POSTVERSIONEXTENSIONUNIX BRANDPACKAGEVERSION 3.4 @@ -125,7 +125,7 @@ LibreOffice_wJRE PRODUCTVERSION 3.4 PRODUCTEXTENSION LONG_PRODUCTEXTENSION - SHORT_PRODUCTEXTENSION beta4 + SHORT_PRODUCTEXTENSION beta5 POSTVERSIONEXTENSION POSTVERSIONEXTENSIONUNIX BRANDPACKAGEVERSION 3.4 @@ -189,7 +189,7 @@ LibreOffice_Dev PRODUCTVERSION 3.4 PRODUCTEXTENSION LONG_PRODUCTEXTENSION - SHORT_PRODUCTEXTENSION beta4 + SHORT_PRODUCTEXTENSION beta5 BASISROOTNAME LibO-dev UNIXBASISROOTNAME lo-dev POSTVERSIONEXTENSION @@ -266,7 +266,7 @@ URE PRODUCTEXTENSION BRANDPACKAGEVERSION 3.4 LONG_PRODUCTEXTENSION - SHORT_PRODUCTEXTENSION beta4 + SHORT_PRODUCTEXTENSION beta5 LICENSENAME LGPL SETSTATICPATH 1 NOVERSIONINDIRNAME 1 @@ -305,7 +305,7 @@ LibreOffice_SDK PRODUCTVERSION 3.4 PRODUCTEXTENSION LONG_PRODUCTEXTENSION - SHORT_PRODUCTEXTENSION beta4 + SHORT_PRODUCTEXTENSION beta5 POSTVERSIONEXTENSION SDK POSTVERSIONEXTENSIONUNIX sdk BRANDPACKAGEVERSION 3.4 @@ -351,7 +351,7 @@ LibreOffice_Dev_SDK PRODUCTVERSION 3.4 PRODUCTEXTENSION LONG_PRODUCTEXTENSION - SHORT_PRODUCTEXTENSION beta4 + SHORT_PRODUCTEXTENSION beta5 BASISROOTNAME LibO-dev UNIXBASISROOTNAME lo-dev POSTVERSIONEXTENSION SDK @@ -403,7 +403,7 @@ OxygenOffice PRODUCTVERSION 3.4 PRODUCTEXTENSION LONG_PRODUCTEXTENSION - SHORT_PRODUCTEXTENSION beta4 + SHORT_PRODUCTEXTENSION beta5 POSTVERSIONEXTENSION POSTVERSIONEXTENSIONUNIX BRANDPACKAGEVERSION 3.4 @@ -473,7 +473,7 @@ OxygenOffice_wJRE PRODUCTVERSION 3.4 PRODUCTEXTENSION LONG_PRODUCTEXTENSION - SHORT_PRODUCTEXTENSION beta4 + SHORT_PRODUCTEXTENSION beta5 POSTVERSIONEXTENSION POSTVERSIONEXTENSIONUNIX BRANDPACKAGEVERSION 3.4 diff --git a/solenv/inc/minor.mk b/solenv/inc/minor.mk index fafb78820522..aad4f45bb97f 100644 --- a/solenv/inc/minor.mk +++ b/solenv/inc/minor.mk @@ -1,5 +1,5 @@ RSCVERSION=300 -RSCREVISION=300m103(Build:4) -BUILD=4 +RSCREVISION=300m103(Build:5) +BUILD=5 LAST_MINOR=m103 SOURCEVERSION=DEV300 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 From 159a9850622b983f55062cded5c45c1de18ad92f Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Tue, 10 May 2011 21:21:55 +0200 Subject: wikihelp: Pass the LibreOffice version to help.libreoffice.org. --- sfx2/source/appl/sfxhelp.cxx | 9 +++++++++ xmlhelp/source/cxxhelp/provider/urlparameter.cxx | 2 ++ 2 files changed, 11 insertions(+) diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 6ab161be9f33..f9dd7cdc814b 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -188,6 +188,15 @@ void AppendConfigToken( String& rURL, sal_Bool bQuestionMark, const rtl::OUStrin rURL += DEFINE_CONST_UNICODE("&System="); rURL += SvtHelpOptions().GetSystem(); + static rtl::OUString aVersion; + if ( aVersion.isEmpty() ) + aVersion = utl::Bootstrap::getProductVersion(); + + if ( !aVersion.isEmpty() ) + { + rURL += DEFINE_CONST_UNICODE( "&Version=" ); + rURL += String( aVersion ); + } } sal_Bool GetHelpAnchor_Impl( const String& _rURL, String& _rAnchor ) diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx index 7f89f12c4c99..f0ca219e1155 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx @@ -697,6 +697,8 @@ bool URLParameter::query() m_nHitCount = value.toInt32(); else if( parameter.compareToAscii( "Active" ) == 0 ) m_aActive = value; + else if( parameter.compareToAscii( "Version" ) == 0 ) + ; // ignored (but accepted) in the build-in help, useful only for the online help else ret = false; } -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 From 9aed026a1c68e27a9f67b58ee3907ecd2d277a18 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Tue, 10 May 2011 21:21:55 +0200 Subject: wikihelp: Pass the LibreOffice version to help.libreoffice.org. --- unotools/inc/unotools/bootstrap.hxx | 3 +++ unotools/source/config/bootstrap.cxx | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/unotools/inc/unotools/bootstrap.hxx b/unotools/inc/unotools/bootstrap.hxx index d17e2940890d..523247b97141 100644 --- a/unotools/inc/unotools/bootstrap.hxx +++ b/unotools/inc/unotools/bootstrap.hxx @@ -55,6 +55,9 @@ namespace utl /// retrieve the product key; uses the given default, if not found static rtl::OUString getProductKey(rtl::OUString const& _sDefault); + /// retrieve the product version + static rtl::OUString getProductVersion(); + /// retrieve the product source (MWS name) static ::rtl::OUString getProductSource(rtl::OUString const& _sDefault); diff --git a/unotools/source/config/bootstrap.cxx b/unotools/source/config/bootstrap.cxx index b19ee6a3683f..adc4b8cbf3a4 100644 --- a/unotools/source/config/bootstrap.cxx +++ b/unotools/source/config/bootstrap.cxx @@ -52,6 +52,7 @@ #define BOOTSTRAP_DATA_NAME SAL_CONFIGFILE("bootstrap") #define BOOTSTRAP_ITEM_PRODUCT_KEY "ProductKey" +#define BOOTSTRAP_ITEM_PRODUCT_VERSION "OOOBaseVersion" #define BOOTSTRAP_ITEM_PRODUCT_SOURCE "ProductSource" #define BOOTSTRAP_ITEM_VERSIONFILE "Location" #define BOOTSTRAP_ITEM_BUILDID "buildid" @@ -652,6 +653,14 @@ OUString Bootstrap::getProductKey(OUString const& _sDefault) } // --------------------------------------------------------------------------------------- +OUString Bootstrap::getProductVersion() +{ + // read OOOBaseVersion from version.ini (versionrc) + OUString sVersion; + data().getVersionValue( OUString( RTL_CONSTASCII_USTRINGPARAM( BOOTSTRAP_ITEM_PRODUCT_VERSION ) ), sVersion, OUString() ); + return sVersion; +} + OUString Bootstrap::getProductSource(OUString const& _sDefault) { OUString const csProductSourceItem(RTL_CONSTASCII_USTRINGPARAM(BOOTSTRAP_ITEM_PRODUCT_SOURCE)); @@ -675,6 +684,7 @@ OUString Bootstrap::getBuildIdData(OUString const& _sDefault) sBuildId = data().getBootstrapValue( csBuildIdItem, _sDefault ); return sBuildId; } + // --------------------------------------------------------------------------------------- OUString Bootstrap::getAllUsersValue(OUString const& _sDefault) -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3