diff options
Diffstat (limited to 'svtools')
22 files changed, 251 insertions, 169 deletions
diff --git a/svtools/inc/svtools/parrtf.hxx b/svtools/inc/svtools/parrtf.hxx index 179f5a28259a..b96e3937231d 100644 --- a/svtools/inc/svtools/parrtf.hxx +++ b/svtools/inc/svtools/parrtf.hxx @@ -30,7 +30,7 @@ #include "svtools/svtdllapi.h" #include <svtools/svparser.hxx> -#include <svl/svarray.hxx> +#include <stack> struct RtfParserState_Impl { @@ -42,7 +42,7 @@ struct RtfParserState_Impl {} }; -SV_DECL_VARARR( RtfParserStates_Impl, RtfParserState_Impl, 16, 16 ) +typedef std::stack< RtfParserState_Impl > RtfParserStates_Impl; class SVT_DLLPUBLIC SvRTFParser : public SvParser { diff --git a/svtools/inc/svtools/rtfkeywd.hxx b/svtools/inc/svtools/rtfkeywd.hxx index 5ccd9149bd68..de59e1d8faf9 100644 --- a/svtools/inc/svtools/rtfkeywd.hxx +++ b/svtools/inc/svtools/rtfkeywd.hxx @@ -39,6 +39,7 @@ #define OOO_STRING_SVTOOLS_RTF_ALT "\\alt" #define OOO_STRING_SVTOOLS_RTF_ANNOTATION "\\annotation" #define OOO_STRING_SVTOOLS_RTF_ANSI "\\ansi" +#define OOO_STRING_SVTOOLS_RTF_ATNDATE "\\atndate" #define OOO_STRING_SVTOOLS_RTF_ATNID "\\atnid" #define OOO_STRING_SVTOOLS_RTF_AUTHOR "\\author" #define OOO_STRING_SVTOOLS_RTF_B "\\b" @@ -976,12 +977,15 @@ #define OOO_STRING_SVTOOLS_RTF_SHPBXCOLUMN "\\shpbxcolumn" #define OOO_STRING_SVTOOLS_RTF_SHPBXMARGIN "\\shpbxmargin" #define OOO_STRING_SVTOOLS_RTF_SHPBXPAGE "\\shpbxpage" +#define OOO_STRING_SVTOOLS_RTF_SHPBXIGNORE "\\shpbxignore" #define OOO_STRING_SVTOOLS_RTF_SHPBYMARGIN "\\shpbymargin" #define OOO_STRING_SVTOOLS_RTF_SHPBYPAGE "\\shpbypage" #define OOO_STRING_SVTOOLS_RTF_SHPBYPARA "\\shpbypara" +#define OOO_STRING_SVTOOLS_RTF_SHPBYIGNORE "\\shpbyignore" #define OOO_STRING_SVTOOLS_RTF_SHPFBLWTXT "\\shpfblwtxt" #define OOO_STRING_SVTOOLS_RTF_SHPFHDR "\\shpfhdr" #define OOO_STRING_SVTOOLS_RTF_SHPGRP "\\shpgrp" +#define OOO_STRING_SVTOOLS_RTF_SHPINST "\\shpinst" #define OOO_STRING_SVTOOLS_RTF_SHPLEFT "\\shpleft" #define OOO_STRING_SVTOOLS_RTF_SHPLID "\\shplid" #define OOO_STRING_SVTOOLS_RTF_SHPLOCKANCHOR "\\shplockanchor" @@ -993,6 +997,7 @@ #define OOO_STRING_SVTOOLS_RTF_SHPWRK "\\shpwrk" #define OOO_STRING_SVTOOLS_RTF_SHPWR "\\shpwr" #define OOO_STRING_SVTOOLS_RTF_SHPZ "\\shpz" +#define OOO_STRING_SVTOOLS_RTF_SP "\\sp" #define OOO_STRING_SVTOOLS_RTF_SPRSBSP "\\sprsbsp" #define OOO_STRING_SVTOOLS_RTF_SPRSLNSP "\\sprslnsp" #define OOO_STRING_SVTOOLS_RTF_SPRSTSM "\\sprstsm" @@ -1116,6 +1121,7 @@ #define OOO_STRING_SVTOOLS_RTF_SHP "\\shp" #define OOO_STRING_SVTOOLS_RTF_SN "\\sn" #define OOO_STRING_SVTOOLS_RTF_SV "\\sv" +#define OOO_STRING_SVTOOLS_RTF_SP "\\sp" // Support for overline attributes #define OOO_STRING_SVTOOLS_RTF_OL "\\ol" @@ -1138,4 +1144,11 @@ #define OOO_STRING_SVTOOLS_RTF_OLHWAVE "\\olhwave" #define OOO_STRING_SVTOOLS_RTF_OLOLDBWAVE "\\ololdbwave" +// Support for nested tables +#define OOO_STRING_SVTOOLS_RTF_ITAP "\\itap" +#define OOO_STRING_SVTOOLS_RTF_NESTCELL "\\nestcell" +#define OOO_STRING_SVTOOLS_RTF_NESTTABLEPROPRS "\\nesttableprops" +#define OOO_STRING_SVTOOLS_RTF_NESTROW "\\nestrow" +#define OOO_STRING_SVTOOLS_RTF_NONESTTABLES "\\nonesttables" + #endif // _RTFKEYWD_HXX diff --git a/svtools/inc/svtools/rtftoken.h b/svtools/inc/svtools/rtftoken.h index e75254487312..f292682a0236 100644 --- a/svtools/inc/svtools/rtftoken.h +++ b/svtools/inc/svtools/rtftoken.h @@ -1258,7 +1258,7 @@ enum RTF_TOKEN_IDS { RTF_SOUTLVL, // shapes - RTF_SHP, RTF_SN, RTF_SV + RTF_SHP, RTF_SN, RTF_SV, RTF_SP /* RTF_SHPLEFT, RTF_SHPTOP, diff --git a/svtools/inc/svtools/svicnvw.hxx b/svtools/inc/svtools/svicnvw.hxx index ac15f0b55be6..68a76d25e108 100644 --- a/svtools/inc/svtools/svicnvw.hxx +++ b/svtools/inc/svtools/svicnvw.hxx @@ -89,7 +89,6 @@ class SvIconView : public SvLBox SvImpIconView* pImp; Image aCollapsedEntryBmp; Image aExpandedEntryBmp; - WinBits nWinBits; USHORT nIcnVwFlags; void SetModel( SvLBoxTreeList* ); @@ -111,6 +110,7 @@ protected: virtual void ReadDragServerInfo( const Point&, SvLBoxDDInfo* ); virtual void Command( const CommandEvent& rCEvt ); virtual void PreparePaint( SvLBoxEntry* ); + virtual void StateChanged( StateChangedType nStateChange ); public: @@ -203,7 +203,6 @@ public: SvLBoxEntry* GetEntryFromLogicPos( const Point& rDocPos ) const; - void SetWindowBits( WinBits nWinStyle ); virtual void PaintEntry( SvLBoxEntry* ); virtual void PaintEntry( SvLBoxEntry*, const Point& rDocPos ); Rectangle GetFocusRect( SvLBoxEntry* ); diff --git a/svtools/inc/svtools/svlbox.hxx b/svtools/inc/svtools/svlbox.hxx index f33784f45397..95fbd9f014d1 100644 --- a/svtools/inc/svtools/svlbox.hxx +++ b/svtools/inc/svtools/svlbox.hxx @@ -47,6 +47,7 @@ #include <vcl/accel.hxx> #endif #include <vcl/mnemonicengine.hxx> +#include <vcl/quickselectionengine.hxx> #include <tools/gen.hxx> #include <svtools/treelist.hxx> #include <svl/svarray.hxx> @@ -253,10 +254,12 @@ DECLARE_SVTREELIST(SvLBoxTreeList, SvLBoxEntry*) class SvLBox; struct SvLBox_Impl { - bool m_bIsEmptyTextAllowed; - bool m_bEntryMnemonicsEnabled; - Link* m_pLink; - ::vcl::MnemonicEngine m_aMnemonicEngine; + bool m_bIsEmptyTextAllowed; + bool m_bEntryMnemonicsEnabled; + bool m_bDoingQuickSelection; + Link* m_pLink; + ::vcl::MnemonicEngine m_aMnemonicEngine; + ::vcl::QuickSelectionEngine m_aQuickSelectionEngine; SvLBox_Impl( SvLBox& _rBox ); }; @@ -267,6 +270,7 @@ class SVT_DLLPUBLIC SvLBox ,public DropTargetHelper ,public DragSourceHelper ,public ::vcl::IMnemonicEntryList + ,public ::vcl::ISearchableStringList { friend class SvLBoxEntry; @@ -290,7 +294,6 @@ class SVT_DLLPUBLIC SvLBox protected: - WinBits nWindowStyle; Link aExpandedHdl; Link aExpandingHdl; Link aSelectHdl; @@ -376,11 +379,18 @@ protected: // for asynchronous D&D sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt, SvLBox* pSourceView ); - // IMnemonicEntryList - virtual const void* FirstSearchEntry( String& _rEntryText ); - virtual const void* NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ); - virtual void SelectSearchEntry( const void* _pEntry ); - virtual void ExecuteSearchEntry( const void* _pEntry ); + void OnCurrentEntryChanged(); + + // IMnemonicEntryList + virtual const void* FirstSearchEntry( String& _rEntryText ) const; + virtual const void* NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) const; + virtual void SelectSearchEntry( const void* _pEntry ); + virtual void ExecuteSearchEntry( const void* _pEntry ) const; + + // ISearchableStringList + virtual ::vcl::StringEntryIdentifier CurrentEntry( String& _out_entryText ) const; + virtual ::vcl::StringEntryIdentifier NextEntry( ::vcl::StringEntryIdentifier _currentEntry, String& _out_entryText ) const; + virtual void SelectEntry( ::vcl::StringEntryIdentifier _entry ); public: diff --git a/svtools/inc/svtools/svtreebx.hxx b/svtools/inc/svtools/svtreebx.hxx index 787e0956888f..79402cb13f23 100644 --- a/svtools/inc/svtools/svtreebx.hxx +++ b/svtools/inc/svtools/svtreebx.hxx @@ -39,11 +39,6 @@ class TabBar; #define SV_TAB_BORDER 8 -#define WB_HASBUTTONSATROOT ((WinBits)0x0800) -#define WB_NOINITIALSELECTION WB_DROPDOWN -#define WB_HIDESELECTION WB_NOHIDESELECTION -#define WB_FORCE_MAKEVISIBLE WB_SPIN - #define SV_LISTBOX_ID_TREEBOX 1 // fuer SvLBox::IsA() #define SV_ENTRYHEIGHTOFFS_PIXEL 2 @@ -97,9 +92,11 @@ class SVT_DLLPUBLIC SvTreeListBox : public SvLBox USHORT nTabFlagMask=0xffff, BOOL bHasClipRegion=FALSE ); - SVT_DLLPRIVATE void InitTreeView( WinBits nWinStyle ); + SVT_DLLPRIVATE void InitTreeView(); SVT_DLLPRIVATE SvLBoxItem* GetItem_Impl( SvLBoxEntry*, long nX, SvLBoxTab** ppTab, USHORT nEmptyWidth ); + SVT_DLLPRIVATE void ImplInitStyle(); + #endif protected: @@ -318,9 +315,6 @@ public: SvLBoxEntry* GetEntry( SvLBoxEntry* pParent, ULONG nPos ) const { return SvLBox::GetEntry(pParent,nPos); } SvLBoxEntry* GetEntry( ULONG nRootPos ) const { return SvLBox::GetEntry(nRootPos);} - void SetWindowBits( WinBits nWinStyle ); - WinBits GetWindowBits() const { return nWindowStyle; } - void PaintEntry( SvLBoxEntry* ); long PaintEntry( SvLBoxEntry*, long nLine, USHORT nTabFlagMask=0xffff ); diff --git a/svtools/inc/svtools/syntaxhighlight.hxx b/svtools/inc/svtools/syntaxhighlight.hxx index 8cf7126fa24c..e406c33fc54f 100644 --- a/svtools/inc/svtools/syntaxhighlight.hxx +++ b/svtools/inc/svtools/syntaxhighlight.hxx @@ -57,8 +57,6 @@ #include <tools/string.hxx> #include <tools/gen.hxx> -#include <svl/svarray.hxx> - // Token-Typen TT_... enum TokenTypes @@ -79,8 +77,7 @@ enum TokenTypes struct HighlightPortion { UINT16 nBegin; UINT16 nEnd; TokenTypes tokenType; }; - -SV_DECL_VARARR(HighlightPortions, HighlightPortion, 0, 16) +typedef std::vector<HighlightPortion> HighlightPortions; ///////////////////////////////////////////////////////////////////////// // Hilfsklasse zur Untersuchung von JavaScript-Modulen, zunaechst zum diff --git a/svtools/source/contnr/svicnvw.cxx b/svtools/source/contnr/svicnvw.cxx index b16cd67d12a5..6fd0f5bf0c9c 100644 --- a/svtools/source/contnr/svicnvw.cxx +++ b/svtools/source/contnr/svicnvw.cxx @@ -50,7 +50,6 @@ SvIcnVwDataEntry::~SvIcnVwDataEntry() SvIconView::SvIconView( Window* pParent, WinBits nWinStyle ) : SvLBox( pParent, nWinStyle | WB_BORDER ) { - nWinBits = nWinStyle; nIcnVwFlags = 0; pImp = new SvImpIconView( this, GetModel(), nWinStyle | WB_ICON ); pImp->mpViewData = 0; @@ -72,8 +71,6 @@ SvIconView::SvIconView( Window* pParent , const ResId& rResId ) : SetBackground( Wallpaper( rStyleSettings.GetFieldColor() ) ); SetDefaultFont(); pImp->SetSelectionMode( GetSelectionMode() ); - pImp->SetWindowBits( nWindowStyle ); - nWinBits = nWindowStyle; } SvIconView::~SvIconView() @@ -403,10 +400,11 @@ SvLBoxEntry* SvIconView::GetEntryFromLogicPos( const Point& rDocPos ) const } -void SvIconView::SetWindowBits( WinBits nWinStyle ) +void SvIconView::StateChanged( StateChangedType i_nStateChange ) { - nWinBits = nWinStyle; - pImp->SetWindowBits( nWinStyle ); + SvLBox::StateChanged( i_nStateChange ); + if ( i_nStateChange == STATE_CHANGE_STYLE ) + pImp->SetStyle( GetStyle() ); } void SvIconView::PaintEntry( SvLBoxEntry* pEntry ) @@ -469,6 +467,7 @@ void SvIconView::SelectAll( BOOL bSelect, BOOL ) void SvIconView::SetCurEntry( SvLBoxEntry* _pEntry ) { pImp->SetCursor( _pEntry ); + OnCurrentEntryChanged(); } SvLBoxEntry* SvIconView::GetCurEntry() const diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index 7a06c4a30735..df6475c131ce 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -40,6 +40,8 @@ #include <svimpbox.hxx> #include <rtl/instance.hxx> #include <svtools/svtdata.hxx> +#include <tools/wintypes.hxx> +#ifndef _SVTOOLS_HRC #include <svtools/svtools.hrc> // #102891# -------------------- @@ -75,7 +77,7 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvLBoxTreeList* pLBTree, WinBits n pTree = pLBTree; aSelEng.SetFunctionSet( (FunctionSet*)&aFctSet ); aSelEng.ExpandSelectionOnMouseMove( FALSE ); - SetWindowBits( nWinStyle ); + SetStyle( nWinStyle ); SetSelectionMode( SINGLE_SELECTION ); SetDragDropMode( 0 ); @@ -245,10 +247,10 @@ void SvImpLBox::CalcCellFocusRect( SvLBoxEntry* pEntry, Rectangle& rRect ) } } -void SvImpLBox::SetWindowBits( WinBits nWinStyle ) +void SvImpLBox::SetStyle( WinBits i_nWinStyle ) { - nWinBits = nWinStyle; - if((nWinStyle & WB_SIMPLEMODE) && aSelEng.GetSelectionMode()==MULTIPLE_SELECTION) + m_nStyle = i_nWinStyle; + if ( ( m_nStyle & WB_SIMPLEMODE) && ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION ) ) aSelEng.AddAlways( TRUE ); } @@ -675,6 +677,8 @@ void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect ) } } nFlags &= (~F_DESEL_ALL); + + pView->OnCurrentEntryChanged(); } void SvImpLBox::ShowCursor( BOOL bShow ) @@ -944,7 +948,7 @@ void SvImpLBox::Paint( const Rectangle& rRect ) // erst die Linien Zeichnen, dann clippen! pView->SetClipRegion(); - if( nWinBits & ( WB_HASLINES | WB_HASLINESATROOT ) ) + if( m_nStyle & ( WB_HASLINES | WB_HASLINESATROOT ) ) DrawNet(); pView->SetClipRegion( aClipRegion ); @@ -961,7 +965,7 @@ void SvImpLBox::Paint( const Rectangle& rRect ) { // do not select if multiselection or explicit set BOOL bNotSelect = ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION ) - || ( ( nWinBits & WB_NOINITIALSELECTION ) == WB_NOINITIALSELECTION ); + || ( ( m_nStyle & WB_NOINITIALSELECTION ) == WB_NOINITIALSELECTION ); SetCursor( pStartEntry, bNotSelect ); } @@ -986,7 +990,7 @@ void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop ) if( bInView && (!bMoveToTop || pStartEntry == pEntry) ) return; // ist schon sichtbar - if( pStartEntry || (nWinBits & WB_FORCE_MAKEVISIBLE) ) + if( pStartEntry || (m_nStyle & WB_FORCE_MAKEVISIBLE) ) nFlags &= (~F_FILLING); if( !bInView ) { @@ -1124,7 +1128,7 @@ void SvImpLBox::DrawNet() pView->DrawLine( aPos1, aPos2 ); } // Sichtbar im Control ? - if( n>= nOffs && ((nWinBits & WB_HASLINESATROOT) || !pTree->IsAtRootDepth(pEntry))) + if( n>= nOffs && ((m_nStyle & WB_HASLINESATROOT) || !pTree->IsAtRootDepth(pEntry))) { // kann aPos1 recyclet werden ? if( !pView->IsExpanded(pEntry) ) @@ -1146,7 +1150,7 @@ void SvImpLBox::DrawNet() nY += nEntryHeight; pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); } - if( nWinBits & WB_HASLINESATROOT ) + if( m_nStyle & WB_HASLINESATROOT ) { pEntry = pView->First(); aPos1.X() = pView->GetTabPos( pEntry, pFirstDynamicTab); @@ -1240,7 +1244,8 @@ USHORT SvImpLBox::AdjustScrollBars( Size& rSize ) Size aOSize( pView->Control::GetOutputSizePixel() ); - BOOL bVerSBar = ( pView->nWindowStyle & WB_VSCROLL ) != 0; + const WinBits nWindowStyle = pView->GetStyle(); + BOOL bVerSBar = ( nWindowStyle & WB_VSCROLL ) != 0; BOOL bHorBar = FALSE; long nMaxRight = aOSize.Width(); //GetOutputSize().Width(); Point aOrigin( pView->GetMapMode().GetOrigin() ); @@ -1248,7 +1253,7 @@ USHORT SvImpLBox::AdjustScrollBars( Size& rSize ) nMaxRight += aOrigin.X() - 1; long nVis = nMostRight - aOrigin.X(); if( pTabBar || ( - (pView->nWindowStyle & WB_HSCROLL) && + (nWindowStyle & WB_HSCROLL) && (nVis < nMostRight || nMaxRight < nMostRight) )) bHorBar = TRUE; @@ -1266,7 +1271,7 @@ USHORT SvImpLBox::AdjustScrollBars( Size& rSize ) nMaxRight -= nVerSBarWidth; if( !bHorBar ) { - if( (pView->nWindowStyle & WB_HSCROLL) && + if( (nWindowStyle & WB_HSCROLL) && (nVis < nMostRight || nMaxRight < nMostRight) ) bHorBar = TRUE; } @@ -1431,7 +1436,7 @@ void SvImpLBox::FillView() void SvImpLBox::ShowVerSBar() { - BOOL bVerBar = ( pView->nWindowStyle & WB_VSCROLL ) != 0; + BOOL bVerBar = ( pView->GetStyle() & WB_VSCROLL ) != 0; ULONG nVis = 0; if( !bVerBar ) nVis = pView->GetVisibleCount(); @@ -1673,7 +1678,7 @@ void SvImpLBox::EntrySelected( SvLBoxEntry* pEntry, BOOL bSelect ) return; /* - if( (nWinBits & WB_HIDESELECTION) && pEntry && !pView->HasFocus() ) + if( (m_nStyle & WB_HIDESELECTION) && pEntry && !pView->HasFocus() ) { SvViewData* pViewData = pView->GetViewData( pEntry ); pViewData->SetCursored( bSelect ); @@ -1935,7 +1940,7 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry ) // die Linien invalidieren /* if( (bEntryVisible || bPrevEntryVisible) && - (nWinBits & ( WB_HASLINES | WB_HASLINESATROOT )) ) + (m_nStyle & ( WB_HASLINES | WB_HASLINESATROOT )) ) { SvLBoxTab* pTab = pView->GetFirstDynamicTab(); if( pTab ) @@ -2257,6 +2262,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) SvLBoxEntry* pNewCursor; + const WinBits nWindowStyle = pView->GetStyle(); switch( aCode ) { case KEY_UP: @@ -2340,7 +2346,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) CallEventListeners( VCLEVENT_LISTBOX_SELECT, pCursor ); } } - else if( pView->nWindowStyle & WB_HSCROLL ) + else if( nWindowStyle & WB_HSCROLL ) { long nThumb = aHorSBar.GetThumbPos(); nThumb += aHorSBar.GetLineSize(); @@ -2371,7 +2377,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) CallEventListeners( VCLEVENT_LISTBOX_SELECT, pCursor ); } } - else if ( pView->nWindowStyle & WB_HSCROLL ) + else if ( nWindowStyle & WB_HSCROLL ) { long nThumb = aHorSBar.GetThumbPos(); nThumb -= aHorSBar.GetLineSize(); @@ -2473,13 +2479,17 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) else if ( !bShift /*&& !bMod1*/ ) { if ( aSelEng.IsAddMode() ) + { // toggle selection pView->Select( pCursor, !pView->IsSelected( pCursor ) ); - else + } + else if ( !pView->IsSelected( pCursor ) ) { SelAllDestrAnch( FALSE ); pView->Select( pCursor, TRUE ); } + else + bKeyUsed = FALSE; } else bKeyUsed = FALSE; @@ -2512,7 +2522,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) case KEY_F8: if( bShift && pView->GetSelectionMode()==MULTIPLE_SELECTION && - !(nWinBits & WB_SIMPLEMODE)) + !(m_nStyle & WB_SIMPLEMODE)) { if( aSelEng.IsAlwaysAdding() ) aSelEng.AddAlways( FALSE ); @@ -2560,8 +2570,8 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) case KEY_A: if( bMod1 ) SelAllDestrAnch( TRUE ); -// else -// bKeyUsed = FALSE; #105907# assume user wants to use quicksearch with key "a", so key is handled! + else + bKeyUsed = FALSE; break; case KEY_SUBTRACT: @@ -2672,10 +2682,15 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) break; default: - if( bMod1 || rKeyCode.GetGroup() == KEYGROUP_FKEYS ) - // #105907# CTRL or Function key is pressed, assume user don't want to use quicksearch... - // if there are groups of keys which should not be handled, they can be added here - bKeyUsed = FALSE; + // is there any reason why we should eat the events here? The only place where this is called + // is from SvTreeListBox::KeyInput. If we set bKeyUsed to TRUE here, then the key input + // is just silenced. However, we want SvLBox::KeyInput to get a chance, to do the QuickSelection + // handling. + // (The old code here which intentionally set bKeyUsed to TRUE said this was because of "quick search" + // handling, but actually there was no quick search handling anymore. We just re-implemented it.) + // #i31275# / 2009-06-16 / frank.schoenheit@sun.com + bKeyUsed = FALSE; + break; } return bKeyUsed; } @@ -2690,7 +2705,7 @@ void __EXPORT SvImpLBox::GetFocus() // if( bSimpleTravel && !pView->IsSelected(pCursor) ) // pView->Select( pCursor, TRUE ); } - if( nWinBits & WB_HIDESELECTION ) + if( m_nStyle & WB_HIDESELECTION ) { SvLBoxEntry* pEntry = pView->FirstSelected(); while( pEntry ) @@ -2723,7 +2738,7 @@ void __EXPORT SvImpLBox::LoseFocus() pView->SetEntryFocus( pCursor,FALSE ); ShowCursor( FALSE ); - if( nWinBits & WB_HIDESELECTION ) + if( m_nStyle & WB_HIDESELECTION ) { SvLBoxEntry* pEntry = pView->FirstSelected(); while( pEntry ) @@ -3021,7 +3036,7 @@ void SvImpLBox::SetSelectionMode( SelectionMode eSelMode ) bSimpleTravel = TRUE; else bSimpleTravel = FALSE; - if( (nWinBits & WB_SIMPLEMODE) && (eSelMode == MULTIPLE_SELECTION) ) + if( (m_nStyle & WB_SIMPLEMODE) && (eSelMode == MULTIPLE_SELECTION) ) aSelEng.AddAlways( TRUE ); } diff --git a/svtools/source/contnr/svimpicn.cxx b/svtools/source/contnr/svimpicn.cxx index d1e471953663..0d335429d564 100644 --- a/svtools/source/contnr/svimpicn.cxx +++ b/svtools/source/contnr/svimpicn.cxx @@ -708,7 +708,7 @@ public: SvImpIconView::SvImpIconView( SvIconView* pCurView, SvLBoxTreeList* pTree, - WinBits nWinStyle ) : + WinBits i_nWinStyle ) : aVerSBar( pCurView, WB_DRAG | WB_VSCROLL ), aHorSBar( pCurView, WB_DRAG | WB_HSCROLL ) { @@ -716,7 +716,7 @@ SvImpIconView::SvImpIconView( SvIconView* pCurView, SvLBoxTreeList* pTree, pModel = pTree; pCurParent = 0; pZOrderList = new SvPtrarr; - SetWindowBits( nWinStyle ); + SetStyle( i_nWinStyle ); nHorDist = 0; nVerDist = 0; nFlags = 0; @@ -785,13 +785,12 @@ void SvImpIconView::Clear( BOOL bInCtor ) AdjustScrollBars(); } -void SvImpIconView::SetWindowBits( WinBits nWinStyle ) +void SvImpIconView::SetStyle( const WinBits i_nWinStyle ) { - nWinBits = nWinStyle; nViewMode = VIEWMODE_TEXT; - if( nWinStyle & WB_NAME ) + if( i_nWinStyle & WB_NAME ) nViewMode = VIEWMODE_NAME; - if( nWinStyle & WB_ICON ) + if( i_nWinStyle & WB_ICON ) nViewMode = VIEWMODE_ICON; } @@ -1754,8 +1753,8 @@ void SvImpIconView::AdjustScrollBars() else nVisibleHeight = nRealHeight; - bool bVerSBar = (pView->nWindowStyle & WB_VSCROLL) ? true : false; - bool bHorSBar = (pView->nWindowStyle & WB_HSCROLL) ? true : false; + bool bVerSBar = (pView->GetStyle() & WB_VSCROLL) ? true : false; + bool bHorSBar = (pView->GetStyle() & WB_HSCROLL) ? true : false; USHORT nResult = 0; if( nVirtHeight ) @@ -1903,7 +1902,7 @@ BOOL SvImpIconView::CheckHorScrollBar() return FALSE; const MapMode& rMapMode = pView->GetMapMode(); Point aOrigin( rMapMode.GetOrigin() ); - if(!(pView->nWindowStyle & WB_HSCROLL) && !aOrigin.X() ) + if(!(pView->GetStyle() & WB_HSCROLL) && !aOrigin.X() ) { long nWidth = aOutputSize.Width(); USHORT nCount = pZOrderList->Count(); @@ -1941,7 +1940,7 @@ BOOL SvImpIconView::CheckVerScrollBar() return FALSE; const MapMode& rMapMode = pView->GetMapMode(); Point aOrigin( rMapMode.GetOrigin() ); - if(!(pView->nWindowStyle & WB_VSCROLL) && !aOrigin.Y() ) + if(!(pView->GetStyle() & WB_VSCROLL) && !aOrigin.Y() ) { long nDeepest = 0; long nHeight = aOutputSize.Height(); diff --git a/svtools/source/contnr/svlbox.cxx b/svtools/source/contnr/svlbox.cxx index a69253c69629..11e19c6bab3c 100644 --- a/svtools/source/contnr/svlbox.cxx +++ b/svtools/source/contnr/svlbox.cxx @@ -685,6 +685,7 @@ SvLBox_Impl::SvLBox_Impl( SvLBox& _rBox ) ,m_bEntryMnemonicsEnabled( false ) ,m_pLink( NULL ) ,m_aMnemonicEngine( _rBox ) + ,m_aQuickSelectionEngine( _rBox ) { } @@ -699,7 +700,6 @@ SvLBox::SvLBox( Window* pParent, WinBits nWinStyle ) : DropTargetHelper( this ), DragSourceHelper( this ), eSelMode( NO_SELECTION ) { DBG_CTOR(SvLBox,0); - nWindowStyle = nWinStyle; nDragOptions = DND_ACTION_COPYMOVE | DND_ACTION_LINK; nImpFlags = 0; pTargetEntry = 0; @@ -724,7 +724,6 @@ SvLBox::SvLBox( Window* pParent, const ResId& rResId ) : DBG_CTOR(SvLBox,0); pTargetEntry = 0; nImpFlags = 0; - nWindowStyle = 0; pLBoxImpl = new SvLBox_Impl( *this ); nDragOptions = DND_ACTION_COPYMOVE | DND_ACTION_LINK; nDragDropMode = 0; @@ -1251,6 +1250,12 @@ ULONG SvLBox::SelectChilds( SvLBoxEntry* , BOOL ) return 0; } +void SvLBox::OnCurrentEntryChanged() +{ + if ( !pLBoxImpl->m_bDoingQuickSelection ) + pLBoxImpl->m_aQuickSelectionEngine.Reset(); +} + void SvLBox::SelectAll( BOOL /* bSelect */ , BOOL /* bPaint */ ) { DBG_CHKTHIS(SvLBox,0); @@ -1535,15 +1540,14 @@ void SvLBox::KeyInput( const KeyEvent& rKEvt ) Control::KeyInput( rKEvt ); } -const void* SvLBox::FirstSearchEntry( String& _rEntryText ) +const void* SvLBox::FirstSearchEntry( String& _rEntryText ) const { SvLBoxEntry* pEntry = GetCurEntry(); if ( pEntry ) pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( NextSearchEntry( pEntry, _rEntryText ) ) ); else { - if ( !pEntry ) - pEntry = FirstSelected(); + pEntry = FirstSelected(); if ( !pEntry ) pEntry = First(); } @@ -1554,11 +1558,23 @@ const void* SvLBox::FirstSearchEntry( String& _rEntryText ) return pEntry; } -const void* SvLBox::NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) +const void* SvLBox::NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) const { SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pCurrentSearchEntry ) ); - pEntry = Next( pEntry ); + if ( ( ( GetChildCount( pEntry ) > 0 ) + || ( pEntry->HasChildsOnDemand() ) + ) + && !IsExpanded( pEntry ) + ) + { + pEntry = NextSibling( pEntry ); + } + else + { + pEntry = Next( pEntry ); + } + if ( !pEntry ) pEntry = First(); @@ -1572,7 +1588,7 @@ void SvLBox::SelectSearchEntry( const void* _pEntry ) { SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pEntry ) ); DBG_ASSERT( pEntry, "SvLBox::SelectSearchEntry: invalid entry!" ); - if ( pEntry ) + if ( !pEntry ) return; SelectAll( FALSE ); @@ -1580,17 +1596,50 @@ void SvLBox::SelectSearchEntry( const void* _pEntry ) Select( pEntry ); } -void SvLBox::ExecuteSearchEntry( const void* /*_pEntry*/ ) +void SvLBox::ExecuteSearchEntry( const void* /*_pEntry*/ ) const { // nothing to do here, we have no "execution" } +::vcl::StringEntryIdentifier SvLBox::CurrentEntry( String& _out_entryText ) const +{ + // always accept the current entry if there is one + SvLBoxEntry* pCurrentEntry( GetCurEntry() ); + if ( pCurrentEntry ) + { + _out_entryText = GetEntryText( pCurrentEntry ); + return pCurrentEntry; + } + return FirstSearchEntry( _out_entryText ); +} + +::vcl::StringEntryIdentifier SvLBox::NextEntry( ::vcl::StringEntryIdentifier _currentEntry, String& _out_entryText ) const +{ + return NextSearchEntry( _currentEntry, _out_entryText ); +} + +void SvLBox::SelectEntry( ::vcl::StringEntryIdentifier _entry ) +{ + SelectSearchEntry( _entry ); +} + bool SvLBox::HandleKeyInput( const KeyEvent& _rKEvt ) { - if ( !IsEntryMnemonicsEnabled() ) - return false; + if ( IsEntryMnemonicsEnabled() + && pLBoxImpl->m_aMnemonicEngine.HandleKeyEvent( _rKEvt ) + ) + return true; + + if ( ( GetStyle() & WB_QUICK_SEARCH ) != 0 ) + { + pLBoxImpl->m_bDoingQuickSelection = true; + const bool bHandled = pLBoxImpl->m_aQuickSelectionEngine.HandleKeyEvent( _rKEvt ); + pLBoxImpl->m_bDoingQuickSelection = false; + if ( bHandled ) + return true; + } - return pLBoxImpl->m_aMnemonicEngine.HandleKeyEvent( _rKEvt ); + return false; } SvLBoxEntry* SvLBox::GetEntry( const Point&, BOOL ) const diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx index e8863ebaf43f..9d6bc78caff9 100644 --- a/svtools/source/contnr/svtreebx.cxx +++ b/svtools/source/contnr/svtreebx.cxx @@ -65,10 +65,10 @@ DBG_NAME(SvTreeListBox) #define SV_LBOX_DEFAULT_INDENT_PIXEL 20 SvTreeListBox::SvTreeListBox( Window* pParent, WinBits nWinStyle ) - : SvLBox(pParent,nWinStyle ) + : SvLBox( pParent, nWinStyle ) { DBG_CTOR(SvTreeListBox,0); - InitTreeView( nWinStyle ); + InitTreeView(); SetSublistOpenWithLeftRight(); } @@ -78,13 +78,13 @@ SvTreeListBox::SvTreeListBox( Window* pParent , const ResId& rResId ) { DBG_CTOR(SvTreeListBox,0); - InitTreeView( 0 ); + InitTreeView(); Resize(); SetSublistOpenWithLeftRight(); } -void SvTreeListBox::InitTreeView( WinBits nWinStyle ) +void SvTreeListBox::InitTreeView() { DBG_CHKTHIS(SvTreeListBox,0); pCheckButtonData = NULL; @@ -102,7 +102,7 @@ void SvTreeListBox::InitTreeView( WinBits nWinStyle ) nTreeFlags = TREEFLAG_RECALCTABS; nIndent = SV_LBOX_DEFAULT_INDENT_PIXEL; nEntryHeightOffs = SV_ENTRYHEIGHTOFFS_PIXEL; - pImp = new SvImpLBox( this, GetModel(), nWinStyle ); + pImp = new SvImpLBox( this, GetModel(), GetStyle() ); aContextBmpMode = SVLISTENTRYFLAG_EXPANDED; nContextBmpWidthMax = 0; @@ -110,7 +110,7 @@ void SvTreeListBox::InitTreeView( WinBits nWinStyle ) SetSpaceBetweenEntries( 0 ); SetLineColor(); InitSettings( TRUE, TRUE, TRUE ); - SetWindowBits( nWinStyle ); + ImplInitStyle(); SetTabs(); } @@ -227,8 +227,9 @@ void SvTreeListBox::SetTabs() EndEditing( TRUE ); nTreeFlags &= (~TREEFLAG_RECALCTABS); nFocusWidth = -1; - BOOL bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0; - BOOL bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT | + const WinBits nStyle( GetStyle() ); + BOOL bHasButtons = (nStyle & WB_HASBUTTONS)!=0; + BOOL bHasButtonsAtRoot = (nStyle & (WB_HASLINESATROOT | WB_HASBUTTONSATROOT))!=0; long nStartPos = TAB_STARTPOS; long nNodeWidthPixel = GetExpandedNodeBmp().GetSizePixel().Width(); @@ -1492,12 +1493,14 @@ SvLBoxEntry* SvTreeListBox::GetCurEntry() const return pImp->GetCurEntry(); } -void SvTreeListBox::SetWindowBits( WinBits nWinStyle ) +void SvTreeListBox::ImplInitStyle() { DBG_CHKTHIS(SvTreeListBox,0); - nWindowStyle = nWinStyle; + + const WinBits nWindowStyle = GetStyle(); + nTreeFlags |= TREEFLAG_RECALCTABS; - if( nWinStyle & WB_SORT ) + if( nWindowStyle & WB_SORT ) { GetModel()->SetSortMode( SortAscending ); GetModel()->SetCompareHdl( LINK(this,SvTreeListBox,DefaultCompare)); @@ -1508,9 +1511,9 @@ void SvTreeListBox::SetWindowBits( WinBits nWinStyle ) GetModel()->SetCompareHdl( Link() ); } #ifdef OS2 - nWinStyle |= WB_VSCROLL; + nWindowStyle |= WB_VSCROLL; #endif - pImp->SetWindowBits( nWinStyle ); + pImp->SetStyle( nWindowStyle ); pImp->Resize(); Invalidate(); } @@ -1578,8 +1581,9 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags, BOOL bInUse = pEntry->HasInUseEmphasis(); // wenn eine ClipRegion von aussen gesetzt wird, dann // diese nicht zuruecksetzen - BOOL bResetClipRegion = !bHasClipRegion; - BOOL bHideSelection = ((nWindowStyle & WB_HIDESELECTION) && !HasFocus())!=0; + const WinBits nWindowStyle = GetStyle(); + const BOOL bResetClipRegion = !bHasClipRegion; + const BOOL bHideSelection = ((nWindowStyle & WB_HIDESELECTION) && !HasFocus())!=0; const StyleSettings& rSettings = GetSettings().GetStyleSettings(); Font aHighlightFont( GetFont() ); @@ -2367,6 +2371,7 @@ void SvTreeListBox::ModelNotification( USHORT nActionId, SvListEntry* pEntry1, long SvTreeListBox::GetTextOffset() const { DBG_CHKTHIS(SvTreeListBox,0); + const WinBits nWindowStyle = GetStyle(); BOOL bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0; BOOL bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT | WB_HASBUTTONSATROOT))!=0; @@ -2519,6 +2524,8 @@ void SvTreeListBox::DataChanged( const DataChangedEvent& rDCEvt ) void SvTreeListBox::StateChanged( StateChangedType i_nStateChange ) { SvLBox::StateChanged( i_nStateChange ); + if ( i_nStateChange == STATE_CHANGE_STYLE ) + ImplInitStyle(); } void SvTreeListBox::InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground) diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx index 4acb54de7c3f..574f2bde4e1e 100755 --- a/svtools/source/control/inettbc.cxx +++ b/svtools/source/control/inettbc.cxx @@ -40,7 +40,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/sdbc/XResultSet.hpp> #include <com/sun/star/sdbc/XRow.hpp> -#include <com/sun/star/task/XInteractionHandler.hdl> +#include <com/sun/star/task/XInteractionHandler.hpp> #include <com/sun/star/ucb/NumberedSortingInfo.hpp> #include <com/sun/star/ucb/XAnyCompareFactory.hpp> #include <com/sun/star/ucb/XProgressHandler.hpp> @@ -152,7 +152,7 @@ SvtMatchContext_Impl::SvtMatchContext_Impl( SvtURLBox* pBoxP, const String& rText ) : aLink( STATIC_LINK( this, SvtMatchContext_Impl, Select_Impl ) ) , aBaseURL( pBoxP->aBaseURL ) - , aText( rText ) + , aText( rText ) , pBox( pBoxP ) , bStop( FALSE ) , bOnlyDirectories( pBoxP->bOnlyDirectories ) @@ -413,7 +413,7 @@ void SvtMatchContext_Impl::ReadFolder( const String& rURL, uno::Reference< XDynamicResultSet > xDynResultSet; ResultSetInclude eInclude = INCLUDE_FOLDERS_AND_DOCUMENTS; if ( bOnlyDirectories ) - eInclude = INCLUDE_FOLDERS_ONLY; + eInclude = INCLUDE_FOLDERS_ONLY; xDynResultSet = aCnt.createDynamicCursor( aProps, eInclude ); @@ -641,7 +641,7 @@ void SvtMatchContext_Impl::run() { // if text input is a directory, it must be part of the match list! Until then it is scanned if ( UCBContentHelper::IsFolder( aMainURL ) && aURLObject.hasFinalSlash() ) - Insert( aText, aMatch ); + Insert( aText, aMatch ); else // otherwise the parent folder will be taken aURLObject.removeSegment(); @@ -671,6 +671,7 @@ void SvtMatchContext_Impl::run() aCurObj.SetURL( *aPickList.GetObject( nPos ) ); aCurObj.SetSmartURL( aCurObj.GetURLNoPass()); aCurMainURL = aCurObj.GetMainURL( INetURLObject::NO_DECODE ); + if( eProt != INET_PROT_NOT_VALID && aCurObj.GetProtocol() != eProt ) continue; @@ -695,7 +696,7 @@ void SvtMatchContext_Impl::run() { // try if text matches the scheme String aScheme( INetURLObject::GetScheme( aCurObj.GetProtocol() ) ); - if ( aText.CompareTo( aScheme, aText.Len() ) == COMPARE_EQUAL && aText.Len() < aScheme.Len() ) + if ( aText.CompareIgnoreCaseToAscii( aScheme, aText.Len() ) == COMPARE_EQUAL && aText.Len() < aScheme.Len() ) { if( bFull ) aMatch = aCurObj.GetMainURL( INetURLObject::NO_DECODE ); @@ -714,7 +715,7 @@ void SvtMatchContext_Impl::run() aCurString.Erase( 0, aScheme.Len() ); } - if( aText.CompareTo( aCurString, aText.Len() )== COMPARE_EQUAL ) + if( aText.CompareIgnoreCaseToAscii( aCurString, aText.Len() )== COMPARE_EQUAL ) { if( bFull ) aMatch = aCurObj.GetMainURL( INetURLObject::NO_DECODE ); @@ -845,6 +846,7 @@ SvtURLBox::SvtURLBox( Window* pParent, const ResId& _rResId, INetProtocol eSmart void SvtURLBox::ImplInit() { pImp = new SvtURLBox_Impl(); + SetHelpId( ".uno:OpenURL" ); EnableAutocomplete( FALSE ); @@ -1301,7 +1303,7 @@ sal_Bool SvtURLBox_Impl::TildeParsing( return sal_False; // no such user #else pPasswd = getpwnam( OUStringToOString( OUString( aUserName ), RTL_TEXTENCODING_ASCII_US ).getStr() ); - if( pPasswd ) + if( pPasswd ) aParseTilde = String::CreateFromAscii( pPasswd->pw_dir ); else return sal_False; // no such user diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx index 9e04069fea79..bdbcd253c198 100644..100755 --- a/svtools/source/control/ruler.cxx +++ b/svtools/source/control/ruler.cxx @@ -467,6 +467,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) BOOL bNoTicks = FALSE; // Groessenvorberechnung + // Sizes calculation BOOL bVertRight = FALSE; if ( mnWinStyle & WB_HORZ ) nTickWidth = aPixSize.Width(); @@ -485,19 +486,21 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) } long nMaxWidth = maVirDev.PixelToLogic( Size( mpData->nPageWidth, 0 ), maMapMode ).Width(); if ( nMaxWidth < 0 ) - nMaxWidth *= -1; + nMaxWidth = -nMaxWidth; nMaxWidth /= aImplRulerUnitTab[mnUnitIndex].nTickUnit; UniString aNumStr( UniString::CreateFromInt32( nMaxWidth ) ); long nTxtWidth = GetTextWidth( aNumStr ); - if ( (nTxtWidth*2) > nTickWidth ) + + const long nTextOff = 4; + if ( nTickWidth < nTxtWidth+nTextOff ) { + // Calculate the scale of the ruler long nMulti = 1; long nOrgTick3 = nTick3; - long nTextOff = 2; while ( nTickWidth < nTxtWidth+nTextOff ) { long nOldMulti = nMulti; - if ( !nTickWidth ) + if ( !nTickWidth ) //If nTickWidth equals 0 nMulti *= 10; else if ( nMulti < 10 ) nMulti++; @@ -515,8 +518,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) bNoTicks = TRUE; break; } - if ( nMulti >= 100 ) - nTextOff = 4; + nTick3 = nOrgTick3 * nMulti; aPixSize = maVirDev.LogicToPixel( Size( nTick3, nTick3 ), maMapMode ); if ( mnWinStyle & WB_HORZ ) @@ -540,7 +542,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) { if ( nStart > nMin ) { - // Nur 0 malen, wenn Margin1 nicht gleich dem NullPunkt ist + // 0 is only painted when Margin1 is not equal to zero if ( (mpData->nMargin1Style & RULER_STYLE_INVISIBLE) || (mpData->nMargin1 != 0) ) { aNumStr = (sal_Unicode)'0'; @@ -563,7 +565,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) else n = aPixSize.Height(); - // Tick3 - Ausgabe (Text) + // Tick3 - Output (Text) if ( !(nTick % nTick3) ) { aNumStr = UniString::CreateFromInt32( nTick / aImplRulerUnitTab[mnUnitIndex].nTickUnit ); @@ -572,7 +574,9 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) nX = nStart+n; //different orientation needs a different starting position nY = bVertRight ? nCenter+nTxtHeight2 : nCenter-nTxtHeight2; - if ( nX < nMax ) + + // Check if we can display full number + if ( nX < (nMax-nTxtWidth2) ) { if ( mnWinStyle & WB_HORZ ) nX -= nTxtWidth2; @@ -581,7 +585,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) ImplVDrawText( nX, nY, aNumStr ); } nX = nStart-n; - if ( nX > nMin ) + if ( nX > (nMin+nTxtWidth2) ) { if ( mnWinStyle & WB_HORZ ) nX -= nTxtWidth2; @@ -590,7 +594,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) ImplVDrawText( nX, nY, aNumStr ); } } - // Tick/Tick2 - Ausgabe (Striche) + // Tick/Tick2 - Output (Strokes) else { if ( !(nTick % aImplRulerUnitTab[mnUnitIndex].nTick2) ) @@ -1257,7 +1261,7 @@ void Ruler::ImplFormat() Size aVirDevSize; BOOL b3DLook = !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO); - // VirtualDevice initialisieren + // VirtualDevice initialize if ( mnWinStyle & WB_HORZ ) { aVirDevSize.Width() = mnVirWidth; @@ -1386,15 +1390,15 @@ void Ruler::ImplFormat() if ( nP2 < nVirRight ) nMax--; - // Beschriftung ausgeben + // Draw captions ImplDrawTicks( nMin, nMax, nStart, nCenter ); } - // Spalten ausgeben + // Draw borders if ( mpData->pBorders ) ImplDrawBorders( nVirLeft, nP2, nVirTop, nVirBottom ); - // Einzuege ausgeben + // Draw indents if ( mpData->pIndents ) ImplDrawIndents( nVirLeft, nP2, nVirTop-1, nVirBottom+1 ); @@ -2887,7 +2891,7 @@ void Ruler::SetMargin2( long nPos, USHORT nMarginStyle ) void Ruler::SetLines( USHORT n, const RulerLine* pLineAry ) { - // Testen, ob sich was geaendert hat + // To determine if what has changed if ( mpData->nLines == n ) { USHORT i = n; @@ -2906,18 +2910,18 @@ void Ruler::SetLines( USHORT n, const RulerLine* pLineAry ) return; } - // Neue Werte setzen und neu ausgeben + // New values and new share issue BOOL bMustUpdate; if ( IsReallyVisible() && IsUpdateMode() ) bMustUpdate = TRUE; else bMustUpdate = FALSE; - // Alte Linien loeschen + // Delete old lines if ( bMustUpdate ) ImplInvertLines(); - // Neue Daten setzen + // New data set if ( !n || !pLineAry ) { if ( !mpData->pLines ) diff --git a/svtools/source/edit/editsyntaxhighlighter.cxx b/svtools/source/edit/editsyntaxhighlighter.cxx index 97c22686c24d..c211413af925 100644 --- a/svtools/source/edit/editsyntaxhighlighter.cxx +++ b/svtools/source/edit/editsyntaxhighlighter.cxx @@ -193,7 +193,7 @@ void MultiLineEditSyntaxHighlight::UpdateData() GetTextEngine()->RemoveAttribs( nLine, TRUE ); HighlightPortions aPortions; aHighlighter.getHighlightPortions( nLine, aLine, aPortions ); - for ( USHORT i = 0; i < aPortions.Count(); i++ ) + for ( size_t i = 0; i < aPortions.size(); i++ ) { HighlightPortion& r = aPortions[i]; GetTextEngine()->SetAttrib( TextAttribFontColor( GetColorValue(r.tokenType) ), nLine, r.nBegin, r.nEnd, TRUE ); diff --git a/svtools/source/edit/syntaxhighlight.cxx b/svtools/source/edit/syntaxhighlight.cxx index 5729eb712bfe..87585f5b2587 100644 --- a/svtools/source/edit/syntaxhighlight.cxx +++ b/svtools/source/edit/syntaxhighlight.cxx @@ -34,9 +34,6 @@ #include <tools/debug.hxx> -SV_IMPL_VARARR(HighlightPortions, HighlightPortion) - - // ########################################################################## // ATTENTION: all these words needs to be in small caps // ########################################################################## @@ -849,7 +846,7 @@ void SimpleTokenizer_Impl::getHighlightPortions( UINT32 nParseLine, const String portion.nEnd = (UINT16)(pEndPos - mpStringBegin); portion.tokenType = eType; - portions.Insert(portion, portions.Count()); + portions.push_back(portion); } } diff --git a/svtools/source/edit/textdata.cxx b/svtools/source/edit/textdata.cxx index 32bdfe40a3fb..cb33ea7d50e6 100644 --- a/svtools/source/edit/textdata.cxx +++ b/svtools/source/edit/textdata.cxx @@ -37,7 +37,7 @@ SV_IMPL_PTRARR( TextLines, TextLinePtr ); SV_IMPL_VARARR( TEWritingDirectionInfos, TEWritingDirectionInfo ); -// ------------------------------------------------------------------------- +// ------------------------------------------------------------------------- // (+) class TextSelection // ------------------------------------------------------------------------- @@ -66,7 +66,7 @@ void TextSelection::Justify() } -// ------------------------------------------------------------------------- +// ------------------------------------------------------------------------- // (+) class TETextPortionList // ------------------------------------------------------------------------- TETextPortionList::TETextPortionList() @@ -129,7 +129,7 @@ USHORT TETextPortionList::GetPortionStartIndex( USHORT nPortion ) */ -// ------------------------------------------------------------------------- +// ------------------------------------------------------------------------- // (+) class TEParaPortion // ------------------------------------------------------------------------- TEParaPortion::TEParaPortion( TextNode* pN ) @@ -254,7 +254,7 @@ void TEParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedL } } -// ------------------------------------------------------------------------- +// ------------------------------------------------------------------------- // (+) class TEParaPortions // ------------------------------------------------------------------------- TEParaPortions::TEParaPortions() @@ -274,7 +274,7 @@ void TEParaPortions::Reset() clear(); } -// ------------------------------------------------------------------------- +// ------------------------------------------------------------------------- // (+) class IdleFormatter // ------------------------------------------------------------------------- IdleFormatter::IdleFormatter() diff --git a/svtools/source/inc/svimpbox.hxx b/svtools/source/inc/svimpbox.hxx index cde986b3cb7d..f9e4ee6951fb 100644 --- a/svtools/source/inc/svimpbox.hxx +++ b/svtools/source/inc/svimpbox.hxx @@ -153,7 +153,7 @@ private: USHORT nFlags; USHORT nCurTabPos; - WinBits nWinBits; + WinBits m_nStyle; ExtendedWinBits nExtendedWinBits; BOOL bSimpleTravel : 1; // ist TRUE bei SINGLE_SELECTION BOOL bUpdateMode : 1; @@ -264,7 +264,7 @@ public: ~SvImpLBox(); void Clear(); - void SetWindowBits( WinBits nWinStyle ); + void SetStyle( WinBits i_nWinStyle ); void SetExtendedWindowBits( ExtendedWinBits _nBits ); ExtendedWinBits GetExtendedWindowBits() const { return nExtendedWinBits; } void SetModel( SvLBoxTreeList* pModel ) { pTree = pModel;} diff --git a/svtools/source/inc/svimpicn.hxx b/svtools/source/inc/svimpicn.hxx index 20f98d2bcbbd..7d5c2b1b41e3 100644 --- a/svtools/source/inc/svimpicn.hxx +++ b/svtools/source/inc/svimpicn.hxx @@ -96,7 +96,6 @@ class SvImpIconView nGridDY; long nHorSBarHeight, nVerSBarWidth; - WinBits nWinBits; int nViewMode; long nHorDist; long nVerDist; @@ -171,7 +170,7 @@ public: ~SvImpIconView(); void Clear( BOOL bInCtor = FALSE ); - void SetWindowBits( WinBits nWinStyle ); + void SetStyle( const WinBits i_nWinStyle ); void SetModel( SvLBoxTreeList* pTree, SvLBoxEntry* pParent ) { pModel = pTree; SetCurParent(pParent); } void EntryInserted( SvLBoxEntry*); diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx index 16bb8b20dfe5..7e29dbc4598f 100644 --- a/svtools/source/svrtf/parrtf.cxx +++ b/svtools/source/svrtf/parrtf.cxx @@ -44,8 +44,6 @@ const int MAX_TOKEN_LEN = 128; #define RTF_ISDIGIT( c ) (c >= '0' && c <= '9') #define RTF_ISALPHA( c ) ( (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') ) -SV_IMPL_VARARR( RtfParserStates_Impl, RtfParserState_Impl ) - SvRTFParser::SvRTFParser( SvStream& rIn, BYTE nStackSize ) : SvParser( rIn, nStackSize ), eUNICodeSet( RTL_TEXTENCODING_MS_1252 ), // default ist ANSI-CodeSet @@ -175,14 +173,13 @@ int SvRTFParser::_GetNextToken() nUCharOverread = (BYTE)nTokenValue; #if 1 //cmc: other ifdef breaks #i3584 - aParserStates[ aParserStates.Count()-1]. + aParserStates.top(). nUCharOverread = nUCharOverread; #else if( !nUCharOverread ) - nUCharOverread = aParserStates[ - aParserStates.Count()-1].nUCharOverread; + nUCharOverread = aParserStates.top().nUCharOverread; else - aParserStates[ aParserStates.Count()-1]. + aParserStates.top(). nUCharOverread = nUCharOverread; #endif } @@ -252,12 +249,12 @@ int SvRTFParser::_GetNextToken() if( 0 <= nOpenBrakets ) { RtfParserState_Impl aState( nUCharOverread, GetSrcEncoding() ); - aParserStates.Insert( - aState, sal::static_int_cast< USHORT >(nOpenBrakets) ); + aParserStates.push( aState ); } ++nOpenBrakets; - DBG_ASSERT( nOpenBrakets == aParserStates.Count(), - "ParserStateStack unequal to bracket count" ); + DBG_ASSERT( + static_cast<size_t>(nOpenBrakets) == aParserStates.size(), + "ParserStateStack unequal to bracket count" ); nRet = nNextCh; } break; @@ -266,12 +263,11 @@ int SvRTFParser::_GetNextToken() --nOpenBrakets; if( 0 <= nOpenBrakets ) { - aParserStates.Remove( - sal::static_int_cast< USHORT >(nOpenBrakets) ); - if( aParserStates.Count() ) + aParserStates.pop(); + if( !aParserStates.empty() ) { const RtfParserState_Impl& rRPS = - aParserStates[ aParserStates.Count() - 1 ]; + aParserStates.top(); nUCharOverread = rRPS.nUCharOverread; SetSrcEncoding( rRPS.eCodeSet ); } @@ -281,8 +277,9 @@ int SvRTFParser::_GetNextToken() SetSrcEncoding( GetCodeSet() ); } } - DBG_ASSERT( nOpenBrakets == aParserStates.Count(), - "ParserStateStack unequal to bracket count" ); + DBG_ASSERT( + static_cast<size_t>(nOpenBrakets) == aParserStates.size(), + "ParserStateStack unequal to bracket count" ); nRet = nNextCh; break; @@ -690,8 +687,8 @@ void SvRTFParser::SetEncoding( rtl_TextEncoding eEnc ) if (eEnc == RTL_TEXTENCODING_DONTKNOW) eEnc = GetCodeSet(); - if (aParserStates.Count()) - aParserStates[aParserStates.Count() - 1].eCodeSet = eEnc; + if (!aParserStates.empty()) + aParserStates.top().eCodeSet = eEnc; SetSrcEncoding(eEnc); } diff --git a/svtools/source/svrtf/rtfkeywd.cxx b/svtools/source/svrtf/rtfkeywd.cxx index caca89492cda..7422961c6881 100644 --- a/svtools/source/svrtf/rtfkeywd.cxx +++ b/svtools/source/svrtf/rtfkeywd.cxx @@ -1160,6 +1160,7 @@ static RTF_TokenEntry __FAR_DATA aRTFTokenTab[] = { */ {{OOO_STRING_SVTOOLS_RTF_SN}, RTF_SN}, {{OOO_STRING_SVTOOLS_RTF_SV}, RTF_SV}, + {{OOO_STRING_SVTOOLS_RTF_SP}, RTF_SP}, // Support for overline attributes {{OOO_STRING_SVTOOLS_RTF_OL}, RTF_OL}, diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx index d1ea854cce61..f37d5f80ed68 100644 --- a/svtools/source/uno/treecontrolpeer.cxx +++ b/svtools/source/uno/treecontrolpeer.cxx @@ -1327,12 +1327,12 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An sal_Bool bEnabled = sal_False; if ( aValue >>= bEnabled ) { - WinBits nStyle = rTree.GetWindowBits(); + WinBits nStyle = rTree.GetStyle(); if ( bEnabled ) nStyle |= WB_HIDESELECTION; else nStyle &= ~WB_HIDESELECTION; - rTree.SetWindowBits( nStyle ); + rTree.SetStyle( nStyle ); } } break; @@ -1390,11 +1390,11 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An sal_Bool bEnabled = false; if( aValue >>= bEnabled ) { - WinBits nBits = rTree.GetWindowBits() & (~WB_HASLINES); + WinBits nBits = rTree.GetStyle() & (~WB_HASLINES); if( bEnabled ) nBits |= WB_HASLINES; - if( nBits != rTree.GetWindowBits() ) - rTree.SetWindowBits( nBits ); + if( nBits != rTree.GetStyle() ) + rTree.SetStyle( nBits ); } break; } @@ -1403,11 +1403,11 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An sal_Bool bEnabled = false; if( aValue >>= bEnabled ) { - WinBits nBits = rTree.GetWindowBits() & (~WB_HASLINESATROOT); + WinBits nBits = rTree.GetStyle() & (~WB_HASLINESATROOT); if( bEnabled ) nBits |= WB_HASLINESATROOT; - if( nBits != rTree.GetWindowBits() ) - rTree.SetWindowBits( nBits ); + if( nBits != rTree.GetStyle() ) + rTree.SetStyle( nBits ); } break; } @@ -1428,7 +1428,7 @@ Any TreeControlPeer::getProperty( const ::rtl::OUString& PropertyName ) throw(Ru switch(nPropId) { case BASEPROPERTY_HIDEINACTIVESELECTION: - return Any( ( rTree.GetWindowBits() & WB_HIDESELECTION ) != 0 ? sal_True : sal_False ); + return Any( ( rTree.GetStyle() & WB_HIDESELECTION ) != 0 ? sal_True : sal_False ); case BASEPROPERTY_TREE_SELECTIONTYPE: { @@ -1456,9 +1456,9 @@ Any TreeControlPeer::getProperty( const ::rtl::OUString& PropertyName ) throw(Ru case BASEPROPERTY_TREE_ROOTDISPLAYED: return Any( mbIsRootDisplayed ); case BASEPROPERTY_TREE_SHOWSHANDLES: - return Any( (rTree.GetWindowBits() & WB_HASLINES) != 0 ? sal_True : sal_False ); + return Any( (rTree.GetStyle() & WB_HASLINES) != 0 ? sal_True : sal_False ); case BASEPROPERTY_TREE_SHOWSROOTHANDLES: - return Any( (rTree.GetWindowBits() & WB_HASLINESATROOT) != 0 ? sal_True : sal_False ); + return Any( (rTree.GetStyle() & WB_HASLINESATROOT) != 0 ? sal_True : sal_False ); } } return VCLXWindow::getProperty( PropertyName ); @@ -1527,7 +1527,7 @@ UnoTreeListBoxImpl::UnoTreeListBoxImpl( TreeControlPeer* pPeer, Window* pParent, : SvTreeListBox( pParent, nWinStyle ) , mxPeer( pPeer ) { - SetWindowBits( WB_BORDER | WB_HASLINES |WB_HASBUTTONS | WB_HASLINESATROOT | WB_HASBUTTONSATROOT | WB_HSCROLL ); + SetStyle( WB_BORDER | WB_HASLINES |WB_HASBUTTONS | WB_HASLINESATROOT | WB_HASBUTTONSATROOT | WB_HSCROLL ); SetNodeDefaultImages(); SetSelectHdl( LINK(this, UnoTreeListBoxImpl, OnSelectionChangeHdl) ); SetDeselectHdl( LINK(this, UnoTreeListBoxImpl, OnSelectionChangeHdl) ); |