solenv/bin/build.pl | 57 +++++++++++++++++++++++++++++++++++++++ sw/source/core/crsr/findtxt.cxx | 9 ++---- sw/source/core/crsr/viscrs.cxx | 11 ++----- sw/source/core/doc/tblrwcl.cxx | 6 ++-- sw/source/core/docnode/ndtbl.cxx | 43 ++++++++++++++--------------- sw/source/core/inc/tblrwcl.hxx | 13 +++----- sw/source/core/txtnode/ndtxt.cxx | 15 +++++----- sw/source/ui/app/docstyle.cxx | 20 ++++++------- 8 files changed, 109 insertions(+), 65 deletions(-)
New commits: commit 691518d27ae5d552a75ac14f856dd31d686c2864 Author: Fridrich Å trba <fridrich.st...@bluewin.ch> Date: Tue Sep 20 09:43:40 2011 +0200 Remove some warnings diff --git a/sw/source/core/inc/tblrwcl.hxx b/sw/source/core/inc/tblrwcl.hxx index df93e44..fd9e0df 100644 --- a/sw/source/core/inc/tblrwcl.hxx +++ b/sw/source/core/inc/tblrwcl.hxx @@ -27,6 +27,7 @@ ************************************************************************/ #ifndef _TBLRWCL_HXX #define _TBLRWCL_HXX +#include <cstddef> #include <vector> #include <swtypes.hxx> #include <tblsel.hxx> @@ -103,11 +104,11 @@ public: void AddToUndoHistory( const SwCntntNode& rNd ); sal_uInt16 Count() const { return aBoxes.Count(); } - const SwTableBox& GetBox( sal_uInt16 nPos, sal_uInt16* pWidth = 0 ) const + const SwTableBox& GetBox( std::size_t nPos, sal_uInt16* pWidth = 0 ) const { // hier wird die EndPos der Spalte benoetigt! if( pWidth ) - *pWidth = nPos+1 == aPosArr.size() ? nWidth + *pWidth = (nPos+1 == aPosArr.size()) ? nWidth : aPosArr[ nPos+1 ]; return *aBoxes[ nPos ]; } commit 9035f006f34335ded10b042aabaf9ddc339b18f0 Author: Kevin Hunter <hunt...@earlham.edu> Date: Mon Sep 19 14:28:43 2011 -0400 Update Zenity with progress icon notification Add a "clock" style progress meter for the build via dynamically generated svg images. The colors are rather arbitrarily chosen, but with a very minor attempt to be readable by color-blind folks. A second round cut of this patch might make the fill and stroke colors configurable. diff --git a/solenv/bin/build.pl b/solenv/bin/build.pl index 865e4d1..93a6952 100755 --- a/solenv/bin/build.pl +++ b/solenv/bin/build.pl @@ -1910,10 +1910,67 @@ sub print_announce { $announce_string .= $echo . "=============\n"; print $announce_string; + my $percent_progress = $modules_started / $total_modules; zenity_tooltip("$text"); + my $zenity_icon = create_progress_svg($percent_progress); + zenity_icon( $zenity_icon ) if ( $zenity_icon ); + $module_announced{$prj}++; }; +sub create_progress_svg { + # The colors are rather arbitrarily chosen, but with a very minor attempt + # to be readable by color-blind folks. A second round cut might make + # the fill and stroke colors configurable. + + # This function currently leaves a stray svg file in the tmp directory. + # This shouldn't be too much of a problem, but if the next person in line + # wants to remove this, go ahead. + + if (! zenity_enabled()) { + return undef; + } + + my $pi = 3.1415923; + my $percentage = shift; + my $path = $percentage > .5 ? '1,1' : '0,1'; + + # Creating a "clock" progress meter that starts from the 12 position; the + # cursor starts in the center (M50,50), then goes immediately vertical + # (v-50). Associating sin with x, because it's the /difference/ of where + # the cursor needs to move. Other relevent documentation may be found at + # + # http://www.w3.org/TR/SVG11/paths.html#PathElement and + # http://www.w3.org/TR/SVG11/images/paths/arcs02.svg + + my $x = 50 * sin( $percentage * 2 * $pi ); + my $y = 50 - 50 * cos( $percentage * 2 * $pi ); + + my $progress_file = "$tmp_dir/lo_build_progress.svg"; + open( PROGRESS, '>', $progress_file ) or return undef; + print PROGRESS <<EOF; +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + version="1.1" + viewBox="0 0 100 100"> + <path + d="M50,50 v-50 a50,50 0 $path $x,$y z" + fill="#aaa" + stroke="#00f" + stroke-width="1" /> +</svg> +EOF + + close( PROGRESS ); + + return $progress_file; +} + sub zenity_enabled { return 0 if ($ENV{ENABLE_ZENITY} ne "TRUE"); return 0 if (!defined $ENV{DISPLAY}); commit a0a1c3f4fb730ed3614593c3d8ddb50c23204c29 Author: Daniel Di Marco <d.dima...@gmx.de> Date: Mon Sep 19 23:18:28 2011 +0000 replaced some SvUShorts with std::vector diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index 3add534..9a86bac 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -32,9 +32,6 @@ #include <com/sun/star/util/SearchOptions.hpp> #include <com/sun/star/util/SearchFlags.hpp> -#define _SVSTDARR_USHORTS -#include <svl/svstdarr.hxx> - #include <vcl/svapp.hxx> #include <vcl/window.hxx> @@ -76,7 +73,7 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart, bool bNewHint = true; bool bNewSoftHyphen = true; const xub_StrLen nEnd = rEnde; - SvUShorts aReplaced; + std::vector<sal_uInt16> aReplaced; do { @@ -155,7 +152,7 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart, else { if ( bEmpty ) - aReplaced.Insert( nAkt, aReplaced.Count() ); + aReplaced.push_back( nAkt ); rRet.SetChar( nAkt, '\x7f' ); } } @@ -178,7 +175,7 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart, } while ( true ); - for( sal_uInt16 i = aReplaced.Count(); i; ) + for( sal_uInt16 i = aReplaced.size(); i; ) { const xub_StrLen nTmp = aReplaced[ --i ]; if( nTmp == rRet.Len() - 1 ) diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index 3ec97b2..8940ed2 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -30,11 +30,6 @@ #include "precompiled_sw.hxx" -#ifndef _SVSTDARR_HXX -#define _SVSTDARR_USHORTS -#include <svl/svstdarr.hxx> -#endif - #include <vcl/dialog.hxx> #include <vcl/msgbox.hxx> #include <vcl/wrkwin.hxx> @@ -560,21 +555,21 @@ short SwShellCrsr::MaxReplaceArived() { // Terminate old actions. The table-frames get constructed and // a SSelection can be created. - SvUShorts aArr; + std::vector<sal_uInt16> aArr; sal_uInt16 nActCnt; ViewShell *pShell = const_cast< SwCrsrShell* >( GetShell() ), *pSh = pShell; do { for( nActCnt = 0; pSh->ActionPend(); ++nActCnt ) pSh->EndAction(); - aArr.Insert( nActCnt, aArr.Count() ); + aArr.push_back( nActCnt ); } while( pShell != ( pSh = (ViewShell*)pSh->GetNext() ) ); { nRet = QueryBox( pDlg, SW_RES( MSG_COMCORE_ASKSEARCH )).Execute(); } - for( sal_uInt16 n = 0; n < aArr.Count(); ++n ) + for( sal_uInt16 n = 0; n < aArr.size(); ++n ) { for( nActCnt = aArr[n]; nActCnt--; ) pSh->StartAction(); diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index 82fa926..6ffb020 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -111,7 +111,7 @@ struct CR_SetBoxWidth { SwSelBoxes aBoxes; SwSortTableLines aLines; - SvUShorts aLinesWidth; + std::vector<sal_uInt16> aLinesWidth; SwShareBoxFmts aShareFmts; SwTableNode* pTblNd; SwUndoTblNdsChg* pUndo; @@ -143,7 +143,7 @@ struct CR_SetBoxWidth bSplittBox( rCpy.bSplittBox ), bAnyBoxFnd( rCpy.bAnyBoxFnd ) { aLines.Insert( &rCpy.aLines ); - aLinesWidth.Insert( &rCpy.aLinesWidth, 0 ); + aLinesWidth = rCpy.aLinesWidth; } SwUndoTblNdsChg* CreateUndo( SwUndoId eUndoType ) @@ -161,7 +161,7 @@ struct CR_SetBoxWidth SwTableLinePtr p = (SwTableLine*)rBox.GetUpper(); sal_uInt16 nFndPos; if( aLines.Insert( p, nFndPos )) - aLinesWidth.Insert( nWidth, nFndPos ); + aLinesWidth.insert( aLinesWidth.begin()+nFndPos, nWidth ); else aLinesWidth[ nFndPos ] = aLinesWidth[ nFndPos ] + nWidth; } diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index ad98a53..eceaaa9 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -898,7 +898,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh, new SwEndNode( rRange.aEnd, *pTblNd ); SwDoc* pDoc = GetDoc(); - SvUShorts aPosArr( 0, 16 ); + std::vector<sal_uInt16> aPosArr; SwTable * pTable = &pTblNd->GetTable(); SwTableLine* pLine; SwTableBox* pBox; @@ -927,17 +927,16 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh, { if( *pTxt == cCh ) { - aPosArr.Insert( static_cast<sal_uInt16>( - aFInfo.GetCharPos( nChPos+1, sal_False )), - aPosArr.Count() ); + aPosArr.push_back( static_cast<sal_uInt16>( + aFInfo.GetCharPos( nChPos+1, sal_False )) ); } } - aPosArr.Insert( + aPosArr.push_back( static_cast<sal_uInt16>(aFInfo.GetFrm()->IsVertical() ? aFInfo.GetFrm()->Prt().Bottom() : - aFInfo.GetFrm()->Prt().Right()), - aPosArr.Count() ); + aFInfo.GetFrm()->Prt().Right()) ); + } } @@ -1046,15 +1045,15 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh, // fehlen der 1. Line Boxen, dann kann man das Breiten Array // vergessen! if( !n ) - aPosArr.Remove( 0, aPosArr.Count() ); + aPosArr.clear(); } } - if( aPosArr.Count() ) + if( aPosArr.size() ) { SwTableLines& rLns = pTable->GetTabLines(); sal_uInt16 nLastPos = 0; - for( n = 0; n < aPosArr.Count(); ++n ) + for( n = 0; n < aPosArr.size(); ++n ) { SwTableBoxFmt *pNewFmt = pDoc->MakeTableBoxFmt(); pNewFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, @@ -1283,7 +1282,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes, #endif SwDoc* pDoc = GetDoc(); - SvUShorts aPosArr( 0, 16 ); + std::vector<sal_uInt16> aPosArr; SwTable * pTable = &pTblNd->GetTable(); SwTableLine* pLine; SwTableBox* pBox; @@ -1369,11 +1368,11 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes, // die Tabelle ausgleichen, leere Sections einfuegen sal_uInt16 n; - if( aPosArr.Count() ) + if( aPosArr.size() ) { SwTableLines& rLns = pTable->GetTabLines(); sal_uInt16 nLastPos = 0; - for( n = 0; n < aPosArr.Count(); ++n ) + for( n = 0; n < aPosArr.size(); ++n ) { SwTableBoxFmt *pNewFmt = pDoc->MakeTableBoxFmt(); pNewFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, @@ -2933,7 +2932,7 @@ void SwCollectTblLineBoxes::AddToUndoHistory( const SwCntntNode& rNd ) void SwCollectTblLineBoxes::AddBox( const SwTableBox& rBox ) { - aPosArr.Insert( nWidth, aPosArr.Count() ); + aPosArr.push_back(nWidth); SwTableBox* p = (SwTableBox*)&rBox; aBoxes.Insert( p, aBoxes.Count() ); nWidth = nWidth + (sal_uInt16)rBox.GetFrmFmt()->GetFrmSize().GetWidth(); @@ -2944,9 +2943,9 @@ const SwTableBox* SwCollectTblLineBoxes::GetBoxOfPos( const SwTableBox& rBox ) const SwTableBox* pRet = 0; sal_uInt16 n; - if( aPosArr.Count() ) + if( aPosArr.size() ) { - for( n = 0; n < aPosArr.Count(); ++n ) + for( n = 0; n < aPosArr.size(); ++n ) if( aPosArr[ n ] == nWidth ) break; else if( aPosArr[ n ] > nWidth ) @@ -2956,7 +2955,7 @@ const SwTableBox* SwCollectTblLineBoxes::GetBoxOfPos( const SwTableBox& rBox ) break; } - if( n >= aPosArr.Count() ) + if( n >= aPosArr.size() ) --n; nWidth = nWidth + (sal_uInt16)rBox.GetFrmFmt()->GetFrmSize().GetWidth(); @@ -2969,9 +2968,9 @@ sal_Bool SwCollectTblLineBoxes::Resize( sal_uInt16 nOffset, sal_uInt16 nOldWidth { sal_uInt16 n; - if( aPosArr.Count() ) + if( aPosArr.size() ) { - for( n = 0; n < aPosArr.Count(); ++n ) + for( n = 0; n < aPosArr.size(); ++n ) if( aPosArr[ n ] == nOffset ) break; else if( aPosArr[ n ] > nOffset ) @@ -2981,11 +2980,11 @@ sal_Bool SwCollectTblLineBoxes::Resize( sal_uInt16 nOffset, sal_uInt16 nOldWidth break; } - aPosArr.Remove( 0, n ); + aPosArr.clear(); aBoxes.Remove( 0, n ); // dann die Positionen der neuen Size anpassen - for( n = 0; n < aPosArr.Count(); ++n ) + for( n = 0; n < aPosArr.size(); ++n ) { sal_uLong nSize = nWidth; nSize *= ( aPosArr[ n ] - nOffset ); @@ -2993,7 +2992,7 @@ sal_Bool SwCollectTblLineBoxes::Resize( sal_uInt16 nOffset, sal_uInt16 nOldWidth aPosArr[ n ] = sal_uInt16( nSize ); } } - return 0 != aPosArr.Count(); + return 0 != aPosArr.size(); } sal_Bool lcl_Line_CollectBox( const SwTableLine*& rpLine, void* pPara ) diff --git a/sw/source/core/inc/tblrwcl.hxx b/sw/source/core/inc/tblrwcl.hxx index 23866a3..df93e44 100644 --- a/sw/source/core/inc/tblrwcl.hxx +++ b/sw/source/core/inc/tblrwcl.hxx @@ -27,10 +27,6 @@ ************************************************************************/ #ifndef _TBLRWCL_HXX #define _TBLRWCL_HXX -#ifndef _SVSTDARR_HXX -#define _SVSTDARR_USHORTS -#include <svl/svstdarr.hxx> -#endif #include <vector> #include <swtypes.hxx> #include <tblsel.hxx> @@ -87,7 +83,7 @@ SW_DLLPUBLIC void _DeleteBox( SwTable& rTbl, SwTableBox* pBox, SwUndo* pUndo = 0 class SwCollectTblLineBoxes { - SvUShorts aPosArr; + std::vector<sal_uInt16> aPosArr; SwSelBoxes_SAR aBoxes; SwHistory* pHst; sal_uInt16 nMode, nWidth; @@ -96,7 +92,7 @@ class SwCollectTblLineBoxes public: SwCollectTblLineBoxes( sal_Bool bTop, sal_uInt16 nMd = 0, SwHistory* pHist=0 ) - : aPosArr( 16, 16 ), aBoxes( 16, 16 ), + : aBoxes( 16, 16 ), pHst( pHist ), nMode( nMd ), nWidth( 0 ), bGetFromTop( bTop ), bGetValues( sal_True ) @@ -111,7 +107,7 @@ public: { // hier wird die EndPos der Spalte benoetigt! if( pWidth ) - *pWidth = nPos+1 == aPosArr.Count() ? nWidth + *pWidth = nPos+1 == aPosArr.size() ? nWidth : aPosArr[ nPos+1 ]; return *aBoxes[ nPos ]; } diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 56ad4f4..a38c2d1 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -3135,7 +3135,7 @@ const ModelToViewHelper::ConversionMap* XubString SwTxtNode::GetRedlineTxt( xub_StrLen nIdx, xub_StrLen nLen, sal_Bool bExpandFlds, sal_Bool bWithNum ) const { - SvUShorts aRedlArr; + std::vector<sal_uInt16> aRedlArr; const SwDoc* pDoc = GetDoc(); sal_uInt16 nRedlPos = pDoc->GetRedlinePos( *this, nsRedlineType_t::REDLINE_DELETE ); if( USHRT_MAX != nRedlPos ) @@ -3156,18 +3156,19 @@ XubString SwTxtNode::GetRedlineTxt( xub_StrLen nIdx, xub_StrLen nLen, else if( pREnd->nNode == nNdIdx ) { // von 0 bis nContent ist alles geloescht - aRedlArr.Insert( xub_StrLen(0), aRedlArr.Count() ); - aRedlArr.Insert( pREnd->nContent.GetIndex(), aRedlArr.Count() ); + aRedlArr.push_back( xub_StrLen(0) ); + aRedlArr.push_back( pREnd->nContent.GetIndex() ); } } else if( pRStt->nNode == nNdIdx ) { - aRedlArr.Insert( pRStt->nContent.GetIndex(), aRedlArr.Count() ); + //aRedlArr.Insert( pRStt->nContent.GetIndex(), aRedlArr.Count() ); + aRedlArr.push_back( pRStt->nContent.GetIndex() ); if( pREnd->nNode == nNdIdx ) - aRedlArr.Insert( pREnd->nContent.GetIndex(), aRedlArr.Count() ); + aRedlArr.push_back( pREnd->nContent.GetIndex() ); else { - aRedlArr.Insert( GetTxt().Len(), aRedlArr.Count() ); + aRedlArr.push_back( GetTxt().Len() ); break; // mehr kann nicht kommen } } @@ -3180,7 +3181,7 @@ XubString SwTxtNode::GetRedlineTxt( xub_StrLen nIdx, xub_StrLen nLen, XubString aTxt( GetTxt().Copy( nIdx, nLen ) ); xub_StrLen nTxtStt = nIdx, nIdxEnd = nIdx + aTxt.Len(); - for( sal_uInt16 n = 0; n < aRedlArr.Count(); n += 2 ) + for( sal_uInt16 n = 0; n < aRedlArr.size(); n += 2 ) { xub_StrLen nStt = aRedlArr[ n ], nEnd = aRedlArr[ n+1 ]; if( ( nIdx <= nStt && nStt <= nIdxEnd ) || diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx index b0f0734..15abcb5 100644 --- a/sw/source/ui/app/docstyle.cxx +++ b/sw/source/ui/app/docstyle.cxx @@ -29,8 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -#define _SVSTDARR_USHORTS - #include <svl/smplhint.hxx> #include <hintids.hxx> #include <svl/itemiter.hxx> @@ -1445,30 +1443,30 @@ void lcl_DeleteInfoStyles( sal_uInt16 nFamily, SvPtrarr& rArr, SwDoc& rDoc ) { case SFX_STYLE_FAMILY_CHAR: { - SvUShorts aDelArr; + std::vector<sal_uInt16> aDelArr; const SwCharFmts& rTbl = *rDoc.GetCharFmts(); for( n = 0, nCnt = rTbl.Count(); n < nCnt; ++n ) { void* p = (void*)rTbl[ n ]; if( USHRT_MAX == rArr.GetPos( p )) - aDelArr.Insert( n, 0 ); + aDelArr.insert( aDelArr.begin(), n ); } - for( n = 0, nCnt = aDelArr.Count(); n < nCnt; ++n ) + for( n = 0, nCnt = aDelArr.size(); n < nCnt; ++n ) rDoc.DelCharFmt( aDelArr[ n ] ); } break; case SFX_STYLE_FAMILY_PARA : { - SvUShorts aDelArr; + std::vector<sal_uInt16> aDelArr; const SwTxtFmtColls& rTbl = *rDoc.GetTxtFmtColls(); for( n = 0, nCnt = rTbl.Count(); n < nCnt; ++n ) { void* p = (void*)rTbl[ n ]; if( USHRT_MAX == rArr.GetPos( p )) - aDelArr.Insert( n, 0 ); + aDelArr.insert( aDelArr.begin(), n ); } - for( n = 0, nCnt = aDelArr.Count(); n < nCnt; ++n ) + for( n = 0, nCnt = aDelArr.size(); n < nCnt; ++n ) rDoc.DelTxtFmtColl( aDelArr[ n ] ); } break; @@ -1490,15 +1488,15 @@ void lcl_DeleteInfoStyles( sal_uInt16 nFamily, SvPtrarr& rArr, SwDoc& rDoc ) case SFX_STYLE_FAMILY_PAGE: { - SvUShorts aDelArr; + std::vector<sal_uInt16> aDelArr; for( n = 0, nCnt = rDoc.GetPageDescCnt(); n < nCnt; ++n ) { void* p = (void*)&const_cast<const SwDoc &>(rDoc).GetPageDesc( n ); if( USHRT_MAX == rArr.GetPos( p )) - aDelArr.Insert( n, 0 ); + aDelArr.insert( aDelArr.begin(), n ); } - for( n = 0, nCnt = aDelArr.Count(); n < nCnt; ++n ) + for( n = 0, nCnt = aDelArr.size(); n < nCnt; ++n ) rDoc.DelPageDesc( aDelArr[ n ] ); } break;
_______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits