diff options
author | Stefan Knorr (astron) <heinzlesspam@gmail.com> | 2012-03-14 11:35:04 +0100 |
---|---|---|
committer | Stefan Knorr (astron) <heinzlesspam@gmail.com> | 2012-03-14 12:16:29 +0100 |
commit | 25d571fff37ee353ff3b6c89accb73e853392168 (patch) | |
tree | f5041f0ae04ba9d90feb3d04d399dc2fd8245438 /svtools | |
parent | 0e5430ae15ea941e7c158fa2dde902a098d26504 (diff) |
svtools/source/contnr: translate comments
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/contnr/contentenumeration.hxx | 4 | ||||
-rw-r--r-- | svtools/source/contnr/fileview.cxx | 10 | ||||
-rw-r--r-- | svtools/source/contnr/imivctl.hxx | 47 | ||||
-rw-r--r-- | svtools/source/contnr/imivctl1.cxx | 307 | ||||
-rw-r--r-- | svtools/source/contnr/imivctl2.cxx | 34 | ||||
-rw-r--r-- | svtools/source/contnr/ivctrl.cxx | 10 | ||||
-rw-r--r-- | svtools/source/contnr/svimpbox.cxx | 255 | ||||
-rw-r--r-- | svtools/source/contnr/svlbitm.cxx | 2 | ||||
-rw-r--r-- | svtools/source/contnr/svlbox.cxx | 126 | ||||
-rw-r--r-- | svtools/source/contnr/svtabbx.cxx | 30 | ||||
-rw-r--r-- | svtools/source/contnr/svtreebx.cxx | 181 | ||||
-rw-r--r-- | svtools/source/contnr/treelist.cxx | 99 |
12 files changed, 540 insertions, 565 deletions
diff --git a/svtools/source/contnr/contentenumeration.hxx b/svtools/source/contnr/contentenumeration.hxx index bf5337385eca..612f71ff435d 100644 --- a/svtools/source/contnr/contentenumeration.hxx +++ b/svtools/source/contnr/contentenumeration.hxx @@ -142,8 +142,8 @@ namespace svt //==================================================================== enum EnumerationResult { - SUCCESS, /// the enumration was successfull - ERROR, /// the enumration was unsuccessfull + SUCCESS, /// the enumeration was successful + ERROR, /// the enumeration was unsuccessful RUNNING /// the enumeration is still running, and the maximum wait time has passed }; diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index ab3f6d8f3fcf..9180e77bea86 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -1340,7 +1340,7 @@ sal_Bool SvtFileView::GetParentURL( String& rParentURL ) const } catch( Exception const & ) { - // perhaps an unkown url protocol (e.g. "private:newdoc") + // perhaps an unknown url protocol (e.g. "private:newdoc") } return bRet; @@ -2274,7 +2274,6 @@ void SvtFileView_Impl::CreateVector_Impl( const Sequence < OUString > &rList ) // get the title pEntry->SetNewTitle( aValue.getToken( 0, '\t', nIndex ) ); aDisplayText = pEntry->GetTitle(); - // #83004# -------------------- ReplaceTabWithString( aDisplayText ); aDisplayText += aTab; @@ -2410,7 +2409,7 @@ sal_Bool CompareSortingData_Impl( SortingData_Impl* const aOne, SortingData_Impl switch ( gnColumn ) { case COLUMN_TITLE: - // compare case insensitiv first + // compare case insensitive first nComp = pCollatorWrapper->compareString( aOne->GetLowerTitle(), aTwo->GetLowerTitle() ); if ( nComp == 0 ) @@ -2552,7 +2551,6 @@ String SvtFileView_Impl::FolderInserted( const OUString& rURL, const OUString& r // title, type, size, date aValue = pData->GetTitle(); - // #83004# -------------------- ReplaceTabWithString( aValue ); aValue += aTab; aValue += pData->maType; @@ -2641,7 +2639,7 @@ namespace svtools { QueryDeleteDlg_Impl::QueryDeleteDlg_Impl ( Window* pParent, - const String& rName // Eintragsname + const String& rName // entry name ) : ModalDialog( pParent, SvtResId( DLG_SVT_QUERYDELETE ) ), @@ -2663,7 +2661,7 @@ QueryDeleteDlg_Impl::QueryDeleteDlg_Impl _aAllButton.SetClickHdl( aLink ); _aNoButton.SetClickHdl( aLink ); - // Anzeige der spezifizierten Texte + // display specified texts WinBits nTmpStyle = _aEntry.GetStyle(); nTmpStyle |= WB_PATHELLIPSIS; diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx index 0393f8c935a9..2dc4cf2731a3 100644 --- a/svtools/source/contnr/imivctl.hxx +++ b/svtools/source/contnr/imivctl.hxx @@ -56,7 +56,7 @@ class IcnGridMap_Impl; #define F_VER_SBARSIZE_WITH_HBAR 0x0001 #define F_HOR_SBARSIZE_WITH_VBAR 0x0002 -#define F_PAINTED 0x0004 // sal_True nach erstem Paint +#define F_PAINTED 0x0004 // sal_True after first paint #define F_ADD_MODE 0x0008 #define F_SELECTING_RECT 0x0020 #define F_DOWN_CTRL 0x0080 @@ -67,20 +67,20 @@ class IcnGridMap_Impl; #define F_CLEARING_SELECTION 0x2000 #define F_ARRANGING 0x4000 -// alle Angaben in Pixel -// Abstaende von Fensterraendern +// unit = pixels +// distances from window borders #define LROFFS_WINBORDER 4 #define TBOFFS_WINBORDER 4 -// fuer das Bounding-Rectangle +// for the bounding rectangle #define LROFFS_BOUND 2 #define TBOFFS_BOUND 2 -// Abstand Fokusrechteck - Icon +// distance focus rectangle to icon #define LROFFS_ICON 2 #define TBOFFS_ICON 2 -// Abstaende Icon - Text +// distance icon to text #define HOR_DIST_BMP_STRING 3 #define VER_DIST_BMP_STRING 3 -// Breitenoffset Highlight-Rect bei Text +// width offset of highlight rectangle for Text #define LROFFS_TEXT 2 #define DEFAULT_MAX_VIRT_WIDTH 200 @@ -172,7 +172,7 @@ class SvxIconChoiceCtrl_Impl ScrollBarBox aScrBarBox; Rectangle aCurSelectionRect; SvPtrarr aSelectedRectList; - Timer aEditTimer; // fuer Inplace-Editieren + Timer aEditTimer; // for editing in place Timer aAutoArrangeTimer; Timer aDocRectChangedTimer; Timer aVisRectChangedTimer; @@ -188,20 +188,20 @@ class SvxIconChoiceCtrl_Impl SvtIconChoiceCtrl* pView; IcnCursor_Impl* pImpCursor; IcnGridMap_Impl* pGridMap; - long nMaxVirtWidth; // max. Breite aVirtOutputSize bei ALIGN_TOP - long nMaxVirtHeight; // max. Hoehe aVirtOutputSize bei ALIGN_LEFT + long nMaxVirtWidth; // max. width aVirtOutputSize for ALIGN_TOP + long nMaxVirtHeight; // max. height aVirtOutputSize for ALIGN_LEFT SvxIconChoiceCtrlEntryList_impl* pZOrderList; SvPtrarr* pColumns; IcnViewEdit_Impl* pEdit; WinBits nWinBits; - long nMaxBoundHeight; // Hoehe des hoechsten BoundRects + long nMaxBoundHeight; // height of highest BoundRects sal_uInt16 nFlags; sal_uInt16 nCurTextDrawFlags; sal_uLong nUserEventAdjustScrBars; sal_uLong nUserEventShowCursor; SvxIconChoiceCtrlEntry* pCurHighlightFrame; sal_Bool bHighlightFramePressed; - SvxIconChoiceCtrlEntry* pHead; // Eintrag oben links + SvxIconChoiceCtrlEntry* pHead; // top left entry SvxIconChoiceCtrlEntry* pCursor; SvxIconChoiceCtrlEntry* pPrevDropTarget; SvxIconChoiceCtrlEntry* pHdlEntry; @@ -210,7 +210,7 @@ class SvxIconChoiceCtrl_Impl VirtualDevice* pDDBufDev; VirtualDevice* pDDTempDev; VirtualDevice* pEntryPaintDev; - SvxIconChoiceCtrlEntry* pAnchor; // fuer Selektion + SvxIconChoiceCtrlEntry* pAnchor; // for selection LocalFocus aFocus; // Data for focusrect ::svt::AccessibleFactoryAccess aAccFactory; @@ -289,7 +289,7 @@ class SvxIconChoiceCtrl_Impl void ClipAtVirtOutRect( Rectangle& rRect ) const; void AdjustAtGrid( const SvPtrarr& rRow, SvxIconChoiceCtrlEntry* pStart=0 ); Point AdjustAtGrid( - const Rectangle& rCenterRect, // "Schwerpunkt" des Objekts (typ. Bmp-Rect) + const Rectangle& rCenterRect, // balance point of object (typically Bmp-Rect) const Rectangle& rBoundRect ) const; sal_uLong GetPredecessorGrid( const Point& rDocPos) const; @@ -397,7 +397,7 @@ public: SvxIconChoiceCtrlEntry* GetCurEntry() const { return pCursor; } void SetCursor( SvxIconChoiceCtrlEntry*, - // sal_True == bei Single-Selection die Sel. mitfuehren + // sal_True == carry selection when single-selecting sal_Bool bSyncSingleSelection = sal_True, sal_Bool bShowFocusAsync = sal_False ); @@ -431,7 +431,7 @@ public: const Point& rPos, const Size& rBoundingSize ); - // berechnet alle ungueltigen BoundRects neu + // recalculates all invalid BoundRects void RecalcAllBoundingRectsSmart(); const Rectangle& GetEntryBoundRect( SvxIconChoiceCtrlEntry* ); void InvalidateBoundingRect( Rectangle& rRect ) @@ -461,9 +461,9 @@ public: ::vcl::ControlLayoutData* _pLayoutData = NULL ); - // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == sal_True + // recalculates all BoundingRects if bMustRecalcBoundingRects == sal_True void CheckBoundingRects() { if (bBoundRectsDirty) RecalcAllBoundingRectsSmart(); } - // berechnet alle invalidierten BoundingRects neu + // recalculates all invalidated BoundingRects void ShowTargetEmphasis( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bShow ); void Command( const CommandEvent& rCEvt ); void ToTop( SvxIconChoiceCtrlEntry* ); @@ -536,7 +536,7 @@ public: sal_Bool ArePredecessorsSet() const { return (sal_Bool)(pHead != 0); } SvxIconChoiceCtrlEntry* GetPredecessorHead() const { return pHead; } void SetEntryPredecessor(SvxIconChoiceCtrlEntry* pEntry,SvxIconChoiceCtrlEntry* pPredecessor); - // liefert gueltige Ergebnisse nur im AutoArrange-Modus! + // only delivers valid results when in AutoArrange mode! SvxIconChoiceCtrlEntry* FindEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry, const Point& ); void SetPositionMode( SvxIconChoiceCtrlPositionMode ); @@ -608,15 +608,14 @@ public: ~IcnCursor_Impl(); void Clear(); - // fuer Cursortravelling usw. + // for Cursortravelling etc. SvxIconChoiceCtrlEntry* GoLeftRight( SvxIconChoiceCtrlEntry*, sal_Bool bRight ); SvxIconChoiceCtrlEntry* GoUpDown( SvxIconChoiceCtrlEntry*, sal_Bool bDown ); SvxIconChoiceCtrlEntry* GoPageUpDown( SvxIconChoiceCtrlEntry*, sal_Bool bDown ); - // Erzeugt fuer jede Zeile (Hoehe=nGridDY) eine nach BoundRect.Left() - // sortierte Liste der Eintraege, die in ihr stehen. Eine Liste kann - // leer sein. Die Listen gehen in das Eigentum des Rufenden ueber und - // muessen mit DestroyGridAdjustData geloescht werden + // Creates a list of entries for every row (height = nGridDY) sorted by + // BoundRect.Left(). A list may be empty. The lists become the property of + // the caller and have to be deleted with DestroyGridAdjustData. void CreateGridAjustData( SvPtrarr& pLists, SvxIconChoiceCtrlEntry* pRow=0); static void DestroyGridAdjustData( SvPtrarr& rLists ); }; diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index b0edba9d3628..eec11d10e896 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -250,7 +250,7 @@ void SvxIconChoiceCtrl_Impl::SetStyle( WinBits nWinStyle ) IMPL_LINK( SvxIconChoiceCtrl_Impl, ScrollUpDownHdl, ScrollBar*, pScrollBar ) { StopEntryEditing( sal_True ); - // Pfeil hoch: delta=-1; Pfeil runter: delta=+1 + // arrow up: delta=-1; arrow down: delta=+1 Scroll( 0, pScrollBar->GetDelta(), sal_True ); bEndScrollInvalidate = sal_True; return 0; @@ -259,7 +259,7 @@ IMPL_LINK( SvxIconChoiceCtrl_Impl, ScrollUpDownHdl, ScrollBar*, pScrollBar ) IMPL_LINK( SvxIconChoiceCtrl_Impl, ScrollLeftRightHdl, ScrollBar*, pScrollBar ) { StopEntryEditing( sal_True ); - // Pfeil links: delta=-1; Pfeil rechts: delta=+1 + // arrow left: delta=-1; arrow right: delta=+1 Scroll( pScrollBar->GetDelta(), 0, sal_True ); bEndScrollInvalidate = sal_True; return 0; @@ -309,9 +309,9 @@ void SvxIconChoiceCtrl_Impl::InsertEntry( SvxIconChoiceCtrlEntry* pEntry, size_t } else { - // wenn der UpdateMode sal_True ist, wollen wir nicht pauschal alle - // BoundRects auf 'zu ueberpruefen' setzen, sondern nur das des - // neuen Eintrags. Deshalb kein InvalidateBoundingRect aufrufen! + // If the UpdateMode is sal_True, don't set all bounding rectangles to + // 'to be checked', but only the bounding rectangle of the new entry. + // Thus, don't call InvalidateBoundingRect! pEntry->aRect.Right() = LONG_MAX; if( bUpdateMode ) { @@ -319,7 +319,7 @@ void SvxIconChoiceCtrl_Impl::InsertEntry( SvxIconChoiceCtrlEntry* pEntry, size_t Rectangle aOutputArea( GetOutputRect() ); pGridMap->OccupyGrids( pEntry ); if( !aOutputArea.IsOver( pEntry->aRect ) ) - return; // ist nicht sichtbar + return; // is invisible pView->Invalidate( pEntry->aRect ); } else @@ -421,9 +421,8 @@ void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, sal_Bo void SvxIconChoiceCtrl_Impl::EntrySelected( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bSelect, sal_Bool bSyncPaint ) { - // bei SingleSelection dafuer sorgen, dass der Cursor immer - // auf dem (einzigen) selektierten Eintrag steht. Aber nur, - // wenn es bereits einen Cursor gibt + // When using SingleSelection, make sure that the cursor is always placed + // over the (only) selected entry. (But only if a cursor exists.) if( bSelect && pCursor && eSelectionMode == SINGLE_SELECTION && pEntry != pCursor ) @@ -432,17 +431,17 @@ void SvxIconChoiceCtrl_Impl::EntrySelected( SvxIconChoiceCtrlEntry* pEntry, sal_ //DBG_ASSERT(pView->GetSelectionCount()==1,"selection count?") } - // beim Aufziehen nicht, da sonst die Schleife in SelectRect - // nicht richtig funktioniert! + // Not when dragging though, else the loop in SelectRect doesn't work + // correctly! if( !(nFlags & F_SELECTING_RECT) ) ToTop( pEntry ); if( bUpdateMode ) { if( pEntry == pCursor ) ShowCursor( sal_False ); - if( pView->IsTracking() && (bSelect || !pView->HasBackground()) ) // beim Tracken immer synchron + if( pView->IsTracking() && (bSelect || !pView->HasBackground()) ) // always synchronous when tracking PaintEntry( pEntry ); - else if( bSyncPaint ) // synchron & mit virtuellem OutDev! + else if( bSyncPaint ) // synchronous & with a virtual OutDev! PaintEntryVirtOutDev( pEntry ); else { @@ -471,7 +470,7 @@ void SvxIconChoiceCtrl_Impl::ResetVirtSize() pCur->ClearFlags( ICNVIEW_FLAG_POS_MOVED ); if( pCur->IsPosLocked() ) { - // VirtSize u.a. anpassen + // adapt (among others) VirtSize if( !IsBoundingRectValid( pCur->aRect ) ) FindBoundingRect( pCur ); else @@ -612,7 +611,7 @@ void SvxIconChoiceCtrl_Impl::ImpArrange( sal_Bool bKeepPredecessors ) SetOrigin( Point() ); VisRectChanged(); RecalcAllBoundingRectsSmart(); - // in der Detailsview muss das Invalidieren intelligenter erfolgen + // TODO: the invalidation in the detail view should be more intelligent //if( !(nWinBits & WB_DETAILS )) pView->Invalidate( INVALIDATE_NOCHILDREN ); nFlags &= ~F_ARRANGING; @@ -717,7 +716,7 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect ) if( rRect.IsOver( rBoundRect ) ) { PaintEntry( pEntry, rBoundRect.TopLeft(), pView, sal_True ); - // Eintraege, die neu gezeichnet werden, auf Top setzen + // set entries to Top if they are being repainted pPaintedEntries->push_back( pEntry ); } else @@ -799,7 +798,7 @@ sal_Bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) return sal_True; } - if( pAnchor && (rMEvt.IsShift() || rMEvt.IsMod1())) // Tastaturselektion? + if( pAnchor && (rMEvt.IsShift() || rMEvt.IsMod1())) // keyboard selection? { DBG_ASSERT(eSelectionMode != SINGLE_SELECTION,"Invalid selection mode"); if( rMEvt.IsMod1() ) @@ -889,7 +888,7 @@ sal_Bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) { if( rMEvt.IsLeft() && (nWinBits & WB_HIGHLIGHTFRAME) ) { - pCurHighlightFrame = 0; // Neues painten des Frames erzwingen + pCurHighlightFrame = 0; // force repaint of frame bHighlightFramePressed = sal_True; SetEntryHighlightFrame( pEntry, sal_True ); } @@ -900,13 +899,13 @@ sal_Bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) { if( !bSelected ) { - DeselectAllBut( pEntry, sal_True /* Synchron painten */ ); + DeselectAllBut( pEntry, sal_True /* paint synchronously */ ); SetCursor( pEntry ); SelectEntry( pEntry, sal_True, sal_True, sal_False, sal_True ); } else { - // erst im Up deselektieren, falls Move per D&D! + // deselect only in the Up, if the Move happened via D&D! nFlags |= F_DOWN_DESELECT; if( bEditingEnabled && IsTextHit( pEntry, aDocPos ) && rMEvt.IsLeft()) @@ -964,7 +963,7 @@ sal_Bool SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt ) { bHandled = sal_True; SvxIconChoiceCtrlEntry* pEntry = pCurHighlightFrame; - pCurHighlightFrame = 0; // Neues painten des Frames erzwingen + pCurHighlightFrame = 0; // force repaint of frame bHighlightFramePressed = sal_False; SetEntryHighlightFrame( pEntry, sal_True ); @@ -1265,17 +1264,17 @@ sal_Bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) return bKeyUsed; } -// Berechnet TopLeft der Scrollbars (nicht ihre Groessen!) +// recalculate TopLeft of scrollbars (but not their sizes!) void SvxIconChoiceCtrl_Impl::PositionScrollBars( long nRealWidth, long nRealHeight ) { - // hor scrollbar + // horizontal scrollbar Point aPos( 0, nRealHeight ); aPos.Y() -= nHorSBarHeight; if( aHorSBar.GetPosPixel() != aPos ) aHorSBar.SetPosPixel( aPos ); - // ver scrollbar + // vertical scrollbar aPos.X() = nRealWidth; aPos.Y() = 0; aPos.X() -= nVerSBarWidth; aPos.X()++; @@ -1320,7 +1319,7 @@ void SvxIconChoiceCtrl_Impl::AdjustScrollBars( sal_Bool ) sal_uInt16 nResult = 0; if( nVirtHeight ) { - // activate ver scrollbar ? + // activate vertical scrollbar? if( !bNoVerSBar && (bVerSBar || ( nVirtHeight > nVisibleHeight)) ) { nResult = 0x0001; @@ -1333,7 +1332,7 @@ void SvxIconChoiceCtrl_Impl::AdjustScrollBars( sal_Bool ) nFlags |= F_HOR_SBARSIZE_WITH_VBAR; } - // activate hor scrollbar ? + // activate horizontal scrollbar? if( !bNoHorSBar && (bHorSBar || (nVirtWidth > nVisibleWidth)) ) { nResult |= 0x0002; @@ -1344,11 +1343,11 @@ void SvxIconChoiceCtrl_Impl::AdjustScrollBars( sal_Bool ) else nVisibleHeight = nRealHeight; - // brauchen wir jetzt doch eine senkrechte Scrollbar ? - if( !(nResult & 0x0001) && // nur wenn nicht schon da + // do we need a vertical scrollbar after all? + if( !(nResult & 0x0001) && // only if not already there ( !bNoVerSBar && ((nVirtHeight > nVisibleHeight) || bVerSBar)) ) { - nResult = 3; // beide sind an + nResult = 3; // both turned on nRealWidth -= nVerSBarWidth; if( nRealWidth > nVirtWidth ) @@ -1361,7 +1360,7 @@ void SvxIconChoiceCtrl_Impl::AdjustScrollBars( sal_Bool ) } } - // size ver scrollbar + // size vertical scrollbar long nThumb = aVerSBar.GetThumbPos(); Size aSize( nVerSBarWidth, nRealHeight ); aSize.Height() += 2; @@ -1381,12 +1380,12 @@ void SvxIconChoiceCtrl_Impl::AdjustScrollBars( sal_Bool ) aVerSBar.Hide(); } - // size hor scrollbar + // size horizontal scrollbar nThumb = aHorSBar.GetThumbPos(); aSize.Width() = nRealWidth; aSize.Height() = nHorSBarHeight; aSize.Width()++; - if( nResult & 0x0001 ) // vertikale Scrollbar ? + if( nResult & 0x0001 ) // vertical scrollbar? { aSize.Width()++; nRealWidth++; @@ -1407,8 +1406,8 @@ void SvxIconChoiceCtrl_Impl::AdjustScrollBars( sal_Bool ) } aOutputSize.Width() = nRealWidth; - if( nResult & 0x0002 ) // hor scrollbar ? - nRealHeight++; // weil unterer Rand geclippt wird + if( nResult & 0x0002 ) // horizontal scrollbar ? + nRealHeight++; // because lower border is clipped aOutputSize.Height() = nRealHeight; Rectangle aNewOutRect( GetOutputRect() ); @@ -1435,11 +1434,11 @@ void SvxIconChoiceCtrl_Impl::Resize() const Size& rSize = pView->Control::GetOutputSizePixel(); PositionScrollBars( rSize.Width(), rSize.Height() ); - // Die ScrollBars werden asynchron ein/ausgeblendet, damit abgeleitete - // Klassen im Resize ein Arrange durchfuehren koennen, ohne dass - // die ScrollBars aufblitzen - // Wenn schon ein Event unterwegs ist, dann braucht kein neues verschickt werden, - // zumindest, solange es nur einen EventTypen gibt + // The scrollbars are shown/hidden asynchronously, so derived classes can + // do an Arrange during Resize, without the scrollbars suddenly turning + // on and off again. + // If an event is already underway, we don't need to send a new one, at least + // as long as there is only one event type. if ( ! nUserEventAdjustScrBars ) nUserEventAdjustScrBars = Application::PostUserEvent( LINK( this, SvxIconChoiceCtrl_Impl, UserEventHdl), @@ -1532,7 +1531,7 @@ sal_Bool SvxIconChoiceCtrl_Impl::CheckVerScrollBar() } -// blendet Scrollbars aus, wenn sie nicht mehr benoetigt werden +// hides scrollbars if they're unnecessary void SvxIconChoiceCtrl_Impl::CheckScrollBars() { CheckVerScrollBar(); @@ -1589,7 +1588,7 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, sal_Boo PaintEntry( pEntry, aPos, 0, bIsBackgroundPainted ); } -// Prios der Emphasis: bDropTarget => bCursored => bSelected +// priorities of the emphasis: bDropTarget => bCursored => bSelected void SvxIconChoiceCtrl_Impl::PaintEmphasis( const Rectangle& rTextRect, const Rectangle& rImageRect, sal_Bool bSelected, sal_Bool bDropTarget, sal_Bool bCursored, OutputDevice* pOut, @@ -1638,7 +1637,7 @@ void SvxIconChoiceCtrl_Impl::PaintEmphasis( } } - // Textrechteck zeichnen + // draw text rectangle if( !bSolidTextRect ) { if( !bIsBackgroundPainted ) @@ -1657,14 +1656,14 @@ void SvxIconChoiceCtrl_Impl::PaintEmphasis( pOut->SetLineColor( aOldLineColor ); } - // Bildrechteck zeichnen + // draw image rectangle if( !bSolidImageRect ) { if( !bIsBackgroundPainted ) pOut->Erase( rImageRect ); } -// die Emphasis des Images muss von der abgeleiteten Klasse gezeichnet werden -// (in der virtuellen Funktion DrawEntryImage) +// the emphasis of the images has to be drawn by the derived class (in the +// virtual function DrawEntryImage) // else // pOut->DrawRect( rImageRect ); @@ -1747,8 +1746,8 @@ void SvxIconChoiceCtrl_Impl::PaintEntryVirtOutDev( SvxIconChoiceCtrlEntry* pEntr Wallpaper aPaper( pView->GetBackground() ); Rectangle aRect( aPaper.GetRect() ); - // Rechteck verschieben, so dass das Boundrect des Entries im - // VirtOut-Dev bei 0,0 liegt. + // move rectangle, so the bounding rectangle of the entry lies in + // VirtOut-Dev at 0,0 aRect.Move( -rRect.Left(), -rRect.Top() ); aPaper.SetRect( aRect ); pEntryPaintDev->SetBackground( aPaper ); @@ -1816,8 +1815,8 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P const StyleSettings& rSettings = pOut->GetSettings().GetStyleSettings(); Font aNewFont( aTempFont ); - // bei hart attributierter Font-Fuellcolor muessen wir diese - // hart auf die Highlight-Color setzen + // font fill colors that are attributed "hard" need corresponding "hard" + // attributed highlight colors if( pView->HasFontFillColor() ) { if( (nWinBits & WB_NOHIDESELECTION) || pView->HasFocus() ) @@ -1879,7 +1878,7 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P PaintItem( aTextRect, IcnViewFieldTypeText, pEntry, nTextPaintFlags, pOut ); - // Highlight-Frame zeichnen + // draw highlight frame if( pEntry == pCurHighlightFrame && !bNoEmphasis ) DrawHighlightFrame( pOut, CalcFocusRect( pEntry ), sal_False ); @@ -1914,14 +1913,13 @@ void SvxIconChoiceCtrl_Impl::SetEntryPos( SvxIconChoiceCtrlEntry* pEntry, const { if( bAdjustVirtSize ) { - // Durch das Ausrichten des (ggf. gerade neu positionierten) Eintrags, - // kann er wieder komplett - // in den sichtbaren Bereich rutschen, so dass u.U. doch keine Scrollbar - // eingeblendet werden muss. Um deshalb ein 'Aufblitzen' der - // Scrollbar(s) zu vermeiden, wird zum Aufplustern der virtuellen - // Ausgabegroesse bereits das ausgerichtete Boundrect des - // Eintrags genommen. Die virtuelle Groesse muss angepasst werden, - // da AdjustEntryAtGrid von ihr abhaengt. + // By aligning the (in some cases newly positioned) entry, it + // can become completely visible again, so that maybe we don't + // need a scrollbar after all. To avoid suddenly turning the + // scrollbar(s) on and then off again, we use the aligned + // bounding rectangle of the entry to enlarge the virtual + // output size. The virtual size has to be adapted, because + // AdjustEntryAtGrid depends on it. const Rectangle& rBoundRect = GetEntryBoundRect( pEntry ); Rectangle aCenterRect( CalcBmpRect( pEntry, 0 )); Point aNewPos( AdjustAtGrid( aCenterRect, rBoundRect ) ); @@ -1952,7 +1950,7 @@ void SvxIconChoiceCtrl_Impl::SetEntryPos( SvxIconChoiceCtrlEntry* pEntry, const void SvxIconChoiceCtrl_Impl::SetNoSelection() { - // rekursive Aufrufe ueber SelectEntry abblocken + // block recursive calls via SelectEntry if( !(nFlags & F_CLEARING_SELECTION )) { nFlags |= F_CLEARING_SELECTION; @@ -1964,7 +1962,7 @@ void SvxIconChoiceCtrl_Impl::SetNoSelection() SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetEntry( const Point& rDocPos, sal_Bool bHit ) { CheckBoundingRects(); - // Z-Order-Liste vom Ende her absuchen + // search through z-order list from the end size_t nCount = pZOrderList->size(); while( nCount ) { @@ -2041,7 +2039,7 @@ Rectangle SvxIconChoiceCtrl_Impl::CalcBmpRect( SvxIconChoiceCtrlEntry* pEntry, c case WB_SMALLICON: case WB_DETAILS: aPos.Y() += ( aBound.GetHeight() - aImageSize.Height() ) / 2; - //todo: hor. Abstand zum BoundRect? + //TODO: determine horizontal distance to bounding rectangle return Rectangle( aPos, aImageSize ); default: @@ -2079,10 +2077,10 @@ Rectangle SvxIconChoiceCtrl_Impl::CalcTextRect( SvxIconChoiceCtrlEntry* pEntry, case WB_ICON: aPos.Y() += aImageSize.Height(); aPos.Y() += VER_DIST_BMP_STRING; - // beim Editieren etwas mehr Platz + // at little more space when editing if( bEdit ) { - // 20% rauf + // +20% long nMinWidth = (( (aImageSize.Width()*10) / 100 ) * 2 ) + aImageSize.Width(); if( nMinWidth > nBoundWidth ) @@ -2091,7 +2089,7 @@ Rectangle SvxIconChoiceCtrl_Impl::CalcTextRect( SvxIconChoiceCtrlEntry* pEntry, if( aTextSize.Width() < nMinWidth ) aTextSize.Width() = nMinWidth; - // beim Editieren ist Ueberlappung nach unten erlaubt + // when editing, overlap with the area below is allowed Size aOptSize = aMaxTextRect.GetSize(); if( aOptSize.Height() > aTextSize.Height() ) aTextSize.Height() = aOptSize.Height(); @@ -2253,7 +2251,7 @@ void SvxIconChoiceCtrl_Impl::SetCursor( SvxIconChoiceCtrlEntry* pEntry, sal_Bool { pOldCursor->ClearFlags( ICNVIEW_FLAG_FOCUSED ); if( eSelectionMode == SINGLE_SELECTION && bSyncSingleSelection ) - SelectEntry( pOldCursor, sal_False, sal_True ); // alten Cursor deselektieren + SelectEntry( pOldCursor, sal_False, sal_True ); // deselect old cursor } if( pCursor ) { @@ -2299,7 +2297,7 @@ void SvxIconChoiceCtrl_Impl::ImpHideDDIcon() if( pDDDev ) { Size aSize( pDDDev->GetOutputSizePixel() ); - // pView restaurieren + // restore pView pView->DrawOutDev( aDDLastRectPos, aSize, Point(), aSize, *pDDDev ); } } @@ -2383,7 +2381,7 @@ sal_Bool SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd ) void SvxIconChoiceCtrl_Impl::Command( const CommandEvent& rCEvt ) { - // Rollmaus-Event? + // scroll mouse event? if( (rCEvt.GetCommand() == COMMAND_WHEEL) || (rCEvt.GetCommand() == COMMAND_STARTAUTOSCROLL) || (rCEvt.GetCommand() == COMMAND_AUTOSCROLL) ) @@ -2425,9 +2423,9 @@ void SvxIconChoiceCtrl_Impl::ClipAtVirtOutRect( Rectangle& rRect ) const rRect.Left() = 0; } -// rRect: Bereich des Dokumentes (in Dokumentkoordinaten), der -// sichtbar gemacht werden soll. -// bScrBar == sal_True: Das Rect wurde aufgrund eines ScrollBar-Events berechnet +// rRect: area of the document (in document coordinates) that we want to make +// visible +// bScrBar == sal_True: rectangle was calculated because of a scrollbar event void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, sal_Bool bScrBar, sal_Bool bCallRectChangedHdl ) @@ -2435,21 +2433,21 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, sal_Bool bScrB Rectangle aVirtRect( rRect ); ClipAtVirtOutRect( aVirtRect ); Point aOrigin( pView->GetMapMode().GetOrigin() ); - // in Dokumentkoordinate umwandeln + // convert to document coordinate aOrigin *= -1; Rectangle aOutputArea( GetOutputRect() ); if( aOutputArea.IsInside( aVirtRect ) ) - return; // ist schon sichtbar + return; // is already visible long nDy; if( aVirtRect.Top() < aOutputArea.Top() ) { - // nach oben scrollen (nDy < 0) + // scroll up (nDy < 0) nDy = aVirtRect.Top() - aOutputArea.Top(); } else if( aVirtRect.Bottom() > aOutputArea.Bottom() ) { - // nach unten scrollen (nDy > 0) + // scroll down (nDy > 0) nDy = aVirtRect.Bottom() - aOutputArea.Bottom(); } else @@ -2458,12 +2456,12 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, sal_Bool bScrB long nDx; if( aVirtRect.Left() < aOutputArea.Left() ) { - // nach links scrollen (nDx < 0) + // scroll to the left (nDx < 0) nDx = aVirtRect.Left() - aOutputArea.Left(); } else if( aVirtRect.Right() > aOutputArea.Right() ) { - // nach rechts scrollen (nDx > 0) + // scroll to the right (nDx > 0) nDx = aVirtRect.Right() - aOutputArea.Right(); } else @@ -2479,8 +2477,7 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, sal_Bool bScrB ShowCursor( sal_False ); } - // Origin fuer SV invertieren (damit wir in - // Dokumentkoordinaten scrollen/painten koennen) + // invert origin for SV (so we can scroll/paint using document coordinates) aOrigin *= -1; SetOrigin( aOrigin ); @@ -2495,7 +2492,7 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, sal_Bool bScrB if( bScrollable && GetUpdateMode() ) { - // in umgekehrte Richtung scrollen! + // scroll in reverse direction! pView->Control::Scroll( -nDx, -nDy, aOutputArea, SCROLL_NOCHILDREN | SCROLL_USECLIPREGION | SCROLL_CLIP ); } @@ -2507,7 +2504,7 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, sal_Bool bScrB if( !bScrBar ) { aOrigin *= -1; - // Thumbs korrigieren + // correct thumbs if(aHorSBar.IsVisible() && aHorSBar.GetThumbPos() != aOrigin.X()) aHorSBar.SetThumbPos( aOrigin.X() ); if(aVerSBar.IsVisible() && aVerSBar.GetThumbPos() != aOrigin.Y()) @@ -2518,15 +2515,15 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, sal_Bool bScrB if( GetUpdateMode() ) ShowCursor( sal_True ); - // pruefen, ob ScrollBars noch benoetigt werden + // check if we still need scrollbars CheckScrollBars(); if( bScrollable && GetUpdateMode() ) pView->Update(); - // kann der angeforderte Bereich nicht komplett sichtbar gemacht werden, - // wird auf jeden Fall der Vis-Rect-Changed-Handler gerufen. Eintreten kann der - // Fall z.B. wenn nur wenige Pixel des unteren Randes nicht sichtbar sind, - // eine ScrollBar aber eine groessere Line-Size eingestellt hat. + // If the requested area can not be made completely visible, the + // Vis-Rect-Changed handler is called in any case. This case may occur e.g. + // if only few pixels of the lower border are invisible, but a scrollbar has + // a larger line size. if( bCallRectChangedHdl || GetOutputRect() != rRect ) VisRectChanged(); } @@ -2553,7 +2550,7 @@ void SvxIconChoiceCtrl_Impl::DeselectAllBut( SvxIconChoiceCtrlEntry* pThisEntryN { ClearSelectedRectList(); // - // !!!!!!! Todo: Evtl. Z-Orderlist abarbeiten !!!!!!! + // TODO: work through z-order list, if necessary! // size_t nCount = aEntries.size(); for( size_t nCur = 0; nCur < nCount; nCur++ ) @@ -2570,7 +2567,7 @@ Size SvxIconChoiceCtrl_Impl::GetMinGrid() const { Size aMinSize( aImageSize ); aMinSize.Width() += 2 * LROFFS_BOUND; - aMinSize.Height() += TBOFFS_BOUND; // PB: einmal Offset reicht (FileDlg) + aMinSize.Height() += TBOFFS_BOUND; // single offset is enough (FileDlg) String aStrDummy( RTL_CONSTASCII_USTRINGPARAM( "XXX" ) ); Size aTextSize( pView->GetTextWidth( aStrDummy ), pView->GetTextHeight() ); if( nWinBits & WB_ICON ) @@ -2596,8 +2593,8 @@ void SvxIconChoiceCtrl_Impl::SetGrid( const Size& rSize ) aSize.Height() = aMinSize.Height(); nGridDX = aSize.Width(); - // HACK(Detail-Modus ist noch nicht vollstaendig implementiert!) - // dieses Workaround bringts mit einer Spalte zum Fliegen + // HACK: Detail mode is not yet fully implemented, this workaround makes it + // fly with a single column if( nWinBits & WB_DETAILS ) { const SvxIconChoiceCtrlColumnInfo* pCol = GetColumn( 0 ); @@ -2608,14 +2605,14 @@ void SvxIconChoiceCtrl_Impl::SetGrid( const Size& rSize ) SetDefaultTextSize(); } -// berechnet die maximale Groesse, die das Textrechteck innerhalb des -// umschliessenden Rechtecks einnehmen kann. Im Modus WB_ICON und -// IcnShowTextFull wird Bottom auf LONG_MAX gesetzt +// Calculates the maximum size that the text rectangle may use within its +// bounding rectangle. In WB_ICON mode with IcnShowTextFull, Bottom is set to +// LONG_MAX. Rectangle SvxIconChoiceCtrl_Impl::CalcMaxTextRect( const SvxIconChoiceCtrlEntry* pEntry ) const { Rectangle aBoundRect; - // keine Endlosrekursion! deshalb das Bound-Rect hier nicht berechnen + // avoid infinite recursion: don't calculate the bounding rectangle here if( IsBoundingRectValid( pEntry->aRect ) ) aBoundRect = pEntry->aRect; else @@ -2683,24 +2680,24 @@ void SvxIconChoiceCtrl_Impl::Center( SvxIconChoiceCtrlEntry* pEntry ) const Size aSize( CalcBoundingSize( pEntry ) ); if( nWinBits & WB_ICON ) { - // horizontal zentrieren + // center horizontally long nBorder = pEntry->aGridRect.GetWidth() - aSize.Width(); pEntry->aRect.Left() += nBorder / 2; pEntry->aRect.Right() -= nBorder / 2; } - // vertikal zentrieren + // center vertically pEntry->aRect.Bottom() = pEntry->aRect.Top() + aSize.Height(); } -// Die Deltas entsprechen Offsets, um die die View auf dem Doc verschoben wird -// links, hoch: Offsets < 0 -// rechts, runter: Offsets > 0 +// The deltas are the offsets by which the view is moved on the document. +// left, up: offsets < 0 +// right, down: offsets > 0 void SvxIconChoiceCtrl_Impl::Scroll( long nDeltaX, long nDeltaY, sal_Bool bScrollBar ) { const MapMode& rMapMode = pView->GetMapMode(); Point aOrigin( rMapMode.GetOrigin() ); - // in Dokumentkoordinate umwandeln + // convert to document coordinate aOrigin *= -1; aOrigin.Y() += nDeltaY; aOrigin.X() += nDeltaX; @@ -2724,7 +2721,7 @@ Rectangle SvxIconChoiceCtrl_Impl::CalcFocusRect( SvxIconChoiceCtrlEntry* pEntry Rectangle aBoundRect( GetEntryBoundRect( pEntry ) ); Rectangle aFocusRect( aBoundRect.Left(), aBmpRect.Top() - 1, aBoundRect.Right() - 4, aTextRect.Bottom() + 1 ); - // Das Fokusrechteck soll nicht den Text beruehren + // the focus rectangle should not touch the text if( aFocusRect.Left() - 1 >= pEntry->aRect.Left() ) aFocusRect.Left()--; if( aFocusRect.Right() + 1 <= pEntry->aRect.Right() ) @@ -2733,7 +2730,7 @@ Rectangle SvxIconChoiceCtrl_Impl::CalcFocusRect( SvxIconChoiceCtrlEntry* pEntry return aFocusRect; } -// Der 'Hot Spot' sind die inneren 50% der Rechteckflaeche +// the hot spot is the inner 50 % of the rectangle static Rectangle GetHotSpot( const Rectangle& rRect ) { Rectangle aResult( rRect ); @@ -2764,7 +2761,7 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, sal_Bool bAdd, if( !pZOrderList || !pZOrderList->size() ) return; - // Flag setzen, damit im Select kein ToTop gerufen wird + // set flag, so ToTop won't be called in Select sal_Bool bAlreadySelectingRect = nFlags & F_SELECTING_RECT ? sal_True : sal_False; nFlags |= F_SELECTING_RECT; @@ -2801,48 +2798,47 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, sal_Bool bAdd, if( bOver && !bOverlaps ) { - // Ist im neuen Selektionsrechteck und in keinem alten - // => selektieren + // is inside the new selection rectangle and outside of any old one + // => select if( !bSelected ) SelectEntry( pEntry, sal_True, sal_True, sal_True ); } else if( !bAdd ) { - // ist ausserhalb des Selektionsrechtecks - // => Selektion entfernen + // is outside of the selection rectangle + // => deselect if( bSelected ) SelectEntry( pEntry, sal_False, sal_True, sal_True ); } else if( bAdd && bOverlaps ) { - // Der Eintrag befindet sich in einem alten (=>Aufspannen - // mehrerer Rechtecke mit Ctrl!) Selektionsrechteck - - // Hier ist noch ein Bug! Der Selektionsstatus eines Eintrags - // in einem vorherigen Rechteck, muss restauriert werden, wenn - // er vom aktuellen Selektionsrechteck beruehrt wurde, jetzt aber - // nicht mehr in ihm liegt. Ich gehe hier der Einfachheit halber - // pauschal davon aus, dass die Eintraege in den alten Rechtecken - // alle selektiert sind. Ebenso ist es falsch, die Schnittmenge - // nur zu deselektieren. - // Loesungsmoeglichkeit: Snapshot der Selektion vor dem Auf- - // spannen des Rechtecks merken + // The entry is inside an old (=>span multiple rectangles with Ctrl) + // selection rectangle. + + // There is still a bug here! The selection status of an entry in a + // previous rectangle has to be restored, if it was touched by the + // current selection rectangle but is not inside it any more. + // For simplicity's sake, let's assume that all entries in the old + // rectangles were correctly selected. It is wrong to just deselect + // the intersection. + // Possible solution: remember a snapshot of the selection before + // spanning the rectangle. if( aBoundRect.IsOver( rRect)) { - // Schnittmenge zwischen alten Rects & aktuellem Rect desel. + // deselect intersection between old rectangles and current rectangle if( bSelected ) SelectEntry( pEntry, sal_False, sal_True, sal_True ); } else { - // Eintrag eines alten Rects selektieren + // select entry of an old rectangle if( !bSelected ) SelectEntry( pEntry, sal_True, sal_True, sal_True ); } } else if( !bOver && bSelected ) { - // Der Eintrag liegt voellig ausserhalb und wird deshalb desel. + // this entry is completely outside the rectangle => deselect it SelectEntry( pEntry, sal_False, sal_True, sal_True ); } } @@ -2983,11 +2979,11 @@ IMPL_LINK_NOARG(SvxIconChoiceCtrl_Impl, EditTimeoutHdl) // -// Funktionen zum Ausrichten der Eintraege am Grid +// Function to align entries to the grid // -// pStart == 0: Alle Eintraege werden ausgerichtet -// sonst: Alle Eintraege der Zeile ab einschliesslich pStart werden ausgerichtet +// pStart == 0: align all entries +// else: align all entries of the row from pStart on (including pStart) void SvxIconChoiceCtrl_Impl::AdjustEntryAtGrid( SvxIconChoiceCtrlEntry* pStart ) { SvPtrarr aLists; @@ -2999,7 +2995,7 @@ void SvxIconChoiceCtrl_Impl::AdjustEntryAtGrid( SvxIconChoiceCtrlEntry* pStart ) CheckScrollBars(); } -// Richtet eine Zeile aus, erweitert ggf. die Breite; Bricht die Zeile nicht um +// align a row, might expand width, doesn't break the line void SvxIconChoiceCtrl_Impl::AdjustAtGrid( const SvPtrarr& rRow, SvxIconChoiceCtrlEntry* pStart ) { if( !rRow.Count() ) @@ -3018,9 +3014,9 @@ void SvxIconChoiceCtrl_Impl::AdjustAtGrid( const SvPtrarr& rRow, SvxIconChoiceCt if( !bGo && pCur == pStart ) bGo = sal_True; - //SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pCur); - // Massgebend (fuer unser Auge) ist die Bitmap, da sonst - // durch lange Texte der Eintrag stark springen kann + // SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pCur); + // Decisive (for our eye) is the bitmap, else, the entry might jump too + // much within long texts. const Rectangle& rBoundRect = GetEntryBoundRect( pCur ); Rectangle aCenterRect( CalcBmpRect( pCur, 0 )); if( bGo && !pCur->IsPosLocked() ) @@ -3044,10 +3040,10 @@ void SvxIconChoiceCtrl_Impl::AdjustAtGrid( const SvPtrarr& rRow, SvxIconChoiceCt } } -// Richtet Rect am Grid aus, garantiert jedoch nicht, dass die -// neue Pos. frei ist. Die Pos. kann fuer SetEntryPos verwendet werden. -// Das CenterRect beschreibt den Teil des BoundRects, der fuer -// die Berechnung des Ziel-Rechtecks verwendet wird. +// Aligns a rectangle to the grid, but doesn't guarantee that the new position +// is vacant. The position can be used for SetEntryPos. The CenterRect describes +// a part of the bounding rectangle that is used for calculating the target +// rectangle. Point SvxIconChoiceCtrl_Impl::AdjustAtGrid( const Rectangle& rCenterRect, const Rectangle& rBoundRect ) const { @@ -3057,12 +3053,12 @@ Point SvxIconChoiceCtrl_Impl::AdjustAtGrid( const Rectangle& rCenterRect, aPos.X() -= LROFFS_WINBORDER; aPos.Y() -= TBOFFS_WINBORDER; - // align (ref ist mitte des rects) + // align (the center of the rectangle is the reference) short nGridX = (short)((aPos.X()+(aSize.Width()/2)) / nGridDX); short nGridY = (short)((aPos.Y()+(aSize.Height()/2)) / nGridDY); aPos.X() = nGridX * nGridDX; aPos.Y() = nGridY * nGridDY; - // hor. center + // horizontal center aPos.X() += (nGridDX - rBoundRect.GetSize().Width() ) / 2; aPos.X() += LROFFS_WINBORDER; @@ -3261,8 +3257,8 @@ IMPL_LINK_NOARG(SvxIconChoiceCtrl_Impl, TextEditEndedHdl) pEdit->Hide(); if( pEdit->IsGrabFocus() ) pView->GrabFocus(); - // Das Edit kann nicht hier geloescht werden, weil es noch in einem - // Handler steht. Es wird im Dtor oder im naechsten EditEntry geloescht. + // The edit can not be deleted here, because it is not within a handler. It + // will be deleted in the dtor or in the next EditEntry. pCurEditedEntry = 0; return 0; } @@ -3310,7 +3306,7 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry( sal_uLong pEntry = pEntry->pflink; if( nCount && pEntry == pHead ) { - OSL_FAIL("SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry > Endlosschleife!"); + OSL_FAIL("SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry > infinite loop!"); return 0; } } @@ -3473,7 +3469,7 @@ void SvxIconChoiceCtrl_Impl::InitSettings() if( !pView->HasFont() ) { - // Unit aus den Settings ist Point + // unit (from settings) is Point Font aFont( rStyleSettings.GetFieldFont() ); //const Font& rFont = pView->GetFont(); //if( pView->HasFontTextColor() ) @@ -3552,9 +3548,9 @@ void SvxIconChoiceCtrl_Impl::SetPositionMode( SvxIconChoiceCtrlPositionMode eMod if( eOldMode == IcnViewPositionModeAutoArrange ) { - // positionieren wir verschobene Eintraege 'hart' gibts noch Probleme - // mit ungewollten Ueberlappungen, da diese Eintrage im Arrange - // nicht beruecksichtigt werden. + // when positioning moved entries "hard", there are problems with + // unwanted overlaps, as these entries aren't taken into account in + // Arrange. if( aEntries.size() ) aAutoArrangeTimer.Start(); return; @@ -3606,7 +3602,7 @@ void SvxIconChoiceCtrl_Impl::SetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry { sal_uLong nPos2 = GetEntryListPos( pPredecessor ); if( nPos1 == (nPos2 + 1) ) - return; // ist schon Vorgaenger + return; // is already the predecessor } else if( !nPos1 ) return; @@ -3616,7 +3612,7 @@ void SvxIconChoiceCtrl_Impl::SetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry InitPredecessors(); if( !pPredecessor && pHead == pEntry ) - return; // ist schon der Erste + return; // is already the first one sal_Bool bSetHead = sal_False; if( !pPredecessor ) @@ -3656,7 +3652,7 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindEntryPredecessor( SvxIconCho return aEntries[ nGrid ]; SvxIconChoiceCtrlEntry* pCur = pHead; // Grid 0 - // todo: Liste von hinten aufrollen wenn nGrid > nCount/2 + // TODO: go through list from the end if nGrid > nCount/2 for( sal_uLong nCur = 0; nCur < nGrid; nCur++ ) pCur = pCur->pflink; @@ -3717,7 +3713,7 @@ sal_Bool SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt ) Point aPt( aOptTextRect.TopLeft() ); aPt += pView->GetMapMode().GetOrigin(); aPt = pView->OutputToScreenPixel( aPt ); - // Border der Tiphilfe abziehen + // subtract border of tooltip help aPt.Y() -= 1; aPt.X() -= 3; aOptTextRect.SetPos( aPt ); @@ -3768,8 +3764,8 @@ void SvxIconChoiceCtrl_Impl::SetColumn( sal_uInt16 nIndex, const SvxIconChoiceCt pColumns->Replace( pInfo, nIndex ); } - // HACK(Detail-Modus ist noch nicht vollstaendig implementiert!) - // dieses Workaround bringts mit einer Spalte zum Fliegen + // HACK: Detail mode is not yet fully implemented, this workaround makes it + // fly with a single column if( !nIndex && (nWinBits & WB_DETAILS) ) nGridDX = pInfo->GetWidth(); @@ -3841,15 +3837,14 @@ void SvxIconChoiceCtrl_Impl::HideEntryHighlightFrame() void SvxIconChoiceCtrl_Impl::CallSelectHandler( SvxIconChoiceCtrlEntry* ) { - // Bei aktiviertem Single-Click-Modus sollte der Selektionshandler - // synchron gerufen werden, weil die Selektion automatisch - // weggenommen wird, wenn der Mauszeiger nicht mehr das Objekt - // beruehrt. Es kann sonst zu fehlenden Select-Aufrufen kommen, - // wenn das Objekt aus einer Mausbewegung heraus selektiert wird, - // weil beim Ausloesen des Timers der Mauszeiger das Objekt u.U. - // schon verlassen hat. - // Fuer spezielle Faelle (=>SfxFileDialog!) koennen synchrone - // Aufrufe auch per WB_NOASYNCSELECTHDL erzwungen werden. + // When single-click mode is active, the selection handler should be called + // synchronously, as the selection is automatically taken away once the + // mouse cursor doesn't touch the object any more. Else, we might run into + // missing calls to Select if the object is selected from a mouse movement, + // because when starting the timer, the mouse cursor might have already left + // the object. + // In special cases (=>SfxFileDialog!), synchronous calls can be forced via + // WB_NOASYNCSELECTHDL. if( nWinBits & (WB_NOASYNCSELECTHDL | WB_HIGHLIGHTFRAME) ) { pHdlEntry = 0; diff --git a/svtools/source/contnr/imivctl2.cxx b/svtools/source/contnr/imivctl2.cxx index 887b9c8a4b8f..0bb77a951ba0 100644 --- a/svtools/source/contnr/imivctl2.cxx +++ b/svtools/source/contnr/imivctl2.cxx @@ -92,7 +92,7 @@ void IcnCursor_Impl::ImplCreate() short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / nDeltaHeight ); short nX = (short)( ((rRect.Left()+rRect.Right())/2) / nDeltaWidth ); - // Rundungsfehler abfangen + // capture rounding errors if( nY >= nRows ) nY = sal::static_int_cast< short >(nRows - 1); if( nX >= nCols ) @@ -279,20 +279,20 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(sal_uInt16 nRow,sal_uInt16 nLe /* - Sucht ab dem uebergebenen Eintrag den naechsten rechts- bzw. - linksstehenden. Suchverfahren am Beispiel bRight = sal_True: + Searches, starting from the passed value, the next entry to the left/to the + right. Example for bRight = sal_True: c b c a b c - S 1 1 1 ====> Suchrichtung + S 1 1 1 ====> search direction a b c b c c - S : Startposition - 1 : erstes Suchrechteck - a,b,c : 2., 3., 4. Suchrechteck + S : starting position + 1 : first searched rectangle + a,b,c : 2nd, 3rd, 4th searched rectangle */ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pCtrlEntry, sal_Bool bRight ) @@ -304,7 +304,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pCt sal_uInt16 nX = pCtrlEntry->nX; DBG_ASSERT(nY< nRows,"GoLeftRight:Bad column"); DBG_ASSERT(nX< nCols,"GoLeftRight:Bad row"); - // Nachbar auf gleicher Zeile ? + // neighbor in same row? if( bRight ) pResult = SearchRow( nY, nX, sal::static_int_cast< sal_uInt16 >(nCols-1), nX, sal_True, sal_True ); @@ -423,7 +423,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pCtrlE DBG_ASSERT(nY<nRows,"GoUpDown:Bad column"); DBG_ASSERT(nX<nCols,"GoUpDown:Bad row"); - // Nachbar in gleicher Spalte ? + // neighbor in same column? if( bDown ) pResult = SearchCol( nX, nY, sal::static_int_cast< sal_uInt16 >(nRows-1), nY, sal_True, sal_True ); @@ -493,7 +493,7 @@ void IcnCursor_Impl::CreateGridAjustData( SvPtrarr& rLists, SvxIconChoiceCtrlEnt if( !pRefEntry ) { sal_uInt16 nGridRows = (sal_uInt16)(pView->aVirtOutputSize.Height() / pView->nGridDY); - nGridRows++; // wg. Abrundung! + nGridRows++; // because we round down later! if( !nGridRows ) return; @@ -514,8 +514,8 @@ void IcnCursor_Impl::CreateGridAjustData( SvPtrarr& rLists, SvxIconChoiceCtrlEnt } else { - // Aufbau eines hor. "Schlauchs" auf der RefEntry-Zeile - // UEBERLEGEN: BoundingRect nehmen wg. Ueberlappungen??? + // build a horizontal "tube" in the RefEntry line + // STOP AND THINK: maybe use bounding rectangle because of overlaps? Rectangle rRefRect( pView->CalcBmpRect( pRefEntry ) ); //const Rectangle& rRefRect = pView->GetEntryBoundRect( pRefEntry ); short nRefRow = (short)( ((rRefRect.Top()+rRefRect.Bottom())/2) / pView->nGridDY ); @@ -723,9 +723,9 @@ GridId IcnGridMap_Impl::GetUnoccupiedGrid( sal_Bool bOccupyFound ) } } -// ein Eintrag belegt nur das unter seinem Zentrum liegende GridRect -// diese Variante ist bedeutend schneller als die Belegung ueber das -// Bounding-Rect, kann aber zu kleinen Ueberlappungen fuehren +// An entry only means that there's a GridRect lying under its center. This +// variant is much faster than allocating via the bounding rectangle but can +// lead to small overlaps. void IcnGridMap_Impl::OccupyGrids( const SvxIconChoiceCtrlEntry* pEntry, sal_Bool bOccupy ) { if( !_pGridMap || !_pView->IsBoundingRectValid( pEntry->aRect )) @@ -776,8 +776,8 @@ void IcnGridMap_Impl::OutputSizeChanged() } } -// Independendly of the views alignment (TOP or LEFT) the gridmap -// should contain the data in a continues region, to make it possible +// Independently of the view's alignment (TOP or LEFT), the gridmap +// should contain the data in a continuous region, to make it possible // to copy the whole block if the gridmap needs to be expanded. void IcnGridMap_Impl::GetGridCoord( GridId nId, sal_uInt16& rGridX, sal_uInt16& rGridY ) { diff --git a/svtools/source/contnr/ivctrl.cxx b/svtools/source/contnr/ivctrl.cxx index 9d7a6d564fa7..62628d7ccff5 100644 --- a/svtools/source/contnr/ivctrl.cxx +++ b/svtools/source/contnr/ivctrl.cxx @@ -75,7 +75,7 @@ SvxIconChoiceCtrlColumnInfo::SvxIconChoiceCtrlColumnInfo( const SvxIconChoiceCtr SvtIconChoiceCtrl::SvtIconChoiceCtrl( Window* pParent, WinBits nWinStyle ) : - // WB_CLIPCHILDREN an, da ScrollBars auf dem Fenster liegen! + // WB_CLIPCHILDREN on, as ScrollBars lie on the window! Control( pParent, nWinStyle | WB_CLIPCHILDREN ), _pCurKeyEvent ( NULL ), @@ -339,7 +339,7 @@ void SvtIconChoiceCtrl::KeyInput( const KeyEvent& rKEvt ) } sal_Bool SvtIconChoiceCtrl::DoKeyInput( const KeyEvent& rKEvt ) { - // unter OS/2 bekommen wir auch beim Editieren Key-Up/Down + // under OS/2, we get key up/down even while editing if( IsEntryEditing() ) return sal_True; _pCurKeyEvent = (KeyEvent*)&rKEvt; @@ -395,7 +395,7 @@ void SvtIconChoiceCtrl::SetBackground( const Wallpaper& rPaper ) else { Wallpaper aBackground( rPaper ); - // HACK, da Hintergrund sonst transparent sein koennte + // HACK, as background might be transparent! if( !aBackground.IsBitmap() ) aBackground.SetStyle( WALLPAPER_TILE ); @@ -423,8 +423,8 @@ void SvtIconChoiceCtrl::SetBackground( const Wallpaper& rPaper ) Control::SetBackground( aBackground ); } - // bei hart attributierter Textfarbe keine 'Automatik', die eine - // lesbare Textfarbe einstellt. + // If text colors are attributed "hard," don't use automatism to select + // a readable text color. Font aFont( GetFont() ); aFont.SetColor( rStyleSettings.GetFieldTextColor() ); SetFont( aFont ); diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index e1fdab322a83..ce2214daae12 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -81,8 +81,8 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvLBoxTreeList* pLBTree, WinBits n aVerSBar.SetRange( Range(0,0) ); aVerSBar.Hide(); aHorSBar.SetRange( Range(0,0) ); - aHorSBar.SetPageSize( 24 ); // Pixel - aHorSBar.SetLineSize( 8 ); // Pixel + aHorSBar.SetPageSize( 24 ); // pixels + aHorSBar.SetLineSize( 8 ); // pixels nHorSBarHeight = (short)aHorSBar.GetSizePixel().Height(); nVerSBarWidth = (short)aVerSBar.GetSizePixel().Width(); @@ -90,7 +90,7 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvLBoxTreeList* pLBTree, WinBits n pStartEntry = 0; pCursor = 0; pAnchor = 0; - nVisibleCount = 0; // Anzahl Daten-Zeilen im Control + nVisibleCount = 0; // number of rows of data in control nNodeBmpTabDistance = NODE_BMP_TABDIST_NOTVALID; nYoffsNodeBmp = 0; nNodeBmpWidth = 0; @@ -98,7 +98,7 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvLBoxTreeList* pLBTree, WinBits n bAsyncBeginDrag = sal_False; aAsyncBeginDragTimer.SetTimeout( 0 ); aAsyncBeginDragTimer.SetTimeoutHdl( LINK(this,SvImpLBox,BeginDragHdl)); - // Button-Animation in Listbox + // button animation in listbox pActiveButton = 0; pActiveEntry = 0; pActiveTab = 0; @@ -254,7 +254,7 @@ void SvImpLBox::SetExtendedWindowBits( ExtendedWinBits _nBits ) nExtendedWinBits = _nBits; } -// Das Model darf hier nicht mehr angefasst werden +// don't touch the model any more void SvImpLBox::Clear() { StopUserEvent(); @@ -268,7 +268,7 @@ void SvImpLBox::Clear() nMostRight = -1; pMostRightEntry = 0; - // Der Cursor darf hier nicht mehr angefasst werden! + // don't touch the cursor any more if( pCursor ) { if( pView->HasFocus() ) @@ -301,12 +301,11 @@ void SvImpLBox::Clear() if( !aHorSBar.IsVisible() && !aVerSBar.IsVisible() ) aScrBarBox.Hide(); - // #97680# --------- aContextBmpWidthVector.clear(); } // ********************************************************************* -// Painten, Navigieren, Scrollen +// Paint, navigate, scroll // ********************************************************************* IMPL_LINK_NOARG_INLINE_START(SvImpLBox, EndScrollHdl) @@ -322,11 +321,11 @@ IMPL_LINK_NOARG_INLINE_START(SvImpLBox, EndScrollHdl) IMPL_LINK_NOARG_INLINE_END(SvImpLBox, EndScrollHdl) -// Handler vertikale ScrollBar +// handler for vertical scrollbar IMPL_LINK( SvImpLBox, ScrollUpDownHdl, ScrollBar *, pScrollBar ) { - DBG_ASSERT(!bInVScrollHdl,"Scroll-Handler ueberholt sich!"); + DBG_ASSERT(!bInVScrollHdl,"Scroll handler out-paces itself!"); long nDelta = pScrollBar->GetDelta(); if( !nDelta ) return 0; @@ -612,7 +611,7 @@ void SvImpLBox::RecalcFocusRect() } // -// Setzt Cursor. Passt bei SingleSelection die Selektion an +// Sets cursor. When using SingleSelection, the selection is adjusted. // void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect ) @@ -651,8 +650,8 @@ void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect ) { pView->Select( pCursor, sal_True ); } - // Mehrfachselektion: Im Cursor-Move selektieren, wenn - // nicht im Add-Mode (Ctrl-F8) + // multiple selection: select in cursor move if we're not in + // Add mode (Ctrl-F8) else if( GetUpdateMode() && pView->GetSelectionMode() == MULTIPLE_SELECTION && !(nFlags & F_DESEL_ALL) && !aSelEng.IsAddMode() && @@ -742,7 +741,7 @@ void SvImpLBox::KeyLeftRight( long nDelta ) pView->Update(); BeginScroll(); nFlags &= (~F_FILLING); - pView->NotifyScrolling( 0 ); // 0 == horizontales Scrolling + pView->NotifyScrolling( 0 ); // 0 == horizontal scrolling ShowCursor( sal_False ); // neuen Origin berechnen @@ -766,8 +765,7 @@ void SvImpLBox::KeyLeftRight( long nDelta ) } -// gibt letzten Eintrag zurueck, wenn Position unter -// dem letzten Eintrag ist +// returns the last entry if position is just past the last entry SvLBoxEntry* SvImpLBox::GetClickedEntry( const Point& rPoint ) const { DBG_ASSERT( pView->GetModel(), "SvImpLBox::GetClickedEntry: how can this ever happen? Please tell me (frank.schoenheit@sun.com) how to reproduce!" ); @@ -787,14 +785,14 @@ SvLBoxEntry* SvImpLBox::GetClickedEntry( const Point& rPoint ) const } // -// prueft, ob der Eintrag "richtig" getroffen wurde +// checks if the entry was hit "the right way" // (Focusrect+ ContextBitmap bei TreeListBox) // sal_Bool SvImpLBox::EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPosPixel,long nLine) { sal_Bool bRet; - // bei "besonderen" Entries (mit CheckButtons usw.) sind wir - // nicht so pingelig + // we are not too exact when it comes to "special" entries + // (with CheckButtons etc.) if( pEntry->ItemCount() >= 3 ) return sal_True; @@ -804,7 +802,7 @@ sal_Bool SvImpLBox::EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPosPixel,lo { SvLBoxContextBmp* pBmp = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP)); aRect.Left() -= pBmp->GetSize(pView,pEntry).Width(); - aRect.Left() -= 4; // etwas Speilraum lassen + aRect.Left() -= 4; // a little tolerance } Point aPos( rPosPixel ); aPos -= pView->GetMapMode().GetOrigin(); @@ -816,7 +814,7 @@ sal_Bool SvImpLBox::EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPosPixel,lo } -// gibt 0 zurueck, wenn Position unter dem letzten Eintrag ist +// returns 0 if position is just past the last entry SvLBoxEntry* SvImpLBox::GetEntry( const Point& rPoint ) const { if( (pView->GetEntryCount() == 0) || !pStartEntry || @@ -861,7 +859,7 @@ SvLBoxEntry* SvImpLBox::MakePointVisible(const Point& rPoint,sal_Bool bNotifyScr if( !pEntry ) { sal_uInt16 nSteps = 0xFFFF; - // LastVisible ist noch nicht implementiert! + // TODO: LastVisible is not yet implemented! pEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nSteps )); } if( pEntry ) @@ -878,7 +876,7 @@ SvLBoxEntry* SvImpLBox::MakePointVisible(const Point& rPoint,sal_Bool bNotifyScr Rectangle SvImpLBox::GetClipRegionRect() const { Point aOrigin( pView->GetMapMode().GetOrigin() ); - aOrigin.X() *= -1; // Umrechnung Dokumentkoord. + aOrigin.X() *= -1; // conversion document coordinates Rectangle aClipRect( aOrigin, aOutputSize ); aClipRect.Bottom()++; return aClipRect; @@ -918,10 +916,10 @@ void SvImpLBox::Paint( const Rectangle& rRect ) long nRectHeight = rRect.GetHeight(); long nEntryHeight = pView->GetEntryHeight(); - // Bereich der zu zeichnenden Entries berechnen + // calculate area for the entries we want to draw sal_uInt16 nStartLine = (sal_uInt16)( rRect.Top() / nEntryHeight ); sal_uInt16 nCount = (sal_uInt16)( nRectHeight / nEntryHeight ); - nCount += 2; // keine Zeile vergessen + nCount += 2; // don't miss a row long nY = nStartLine * nEntryHeight; SvLBoxEntry* pEntry = pStartEntry; @@ -933,7 +931,7 @@ void SvImpLBox::Paint( const Rectangle& rRect ) Region aClipRegion( GetClipRegionRect() ); - // erst die Linien Zeichnen, dann clippen! + // first draw the lines, then clip them! pView->SetClipRegion(); if( m_nStyle & ( WB_HASLINES | WB_HASLINESATROOT ) ) DrawNet(); @@ -975,13 +973,13 @@ void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop ) sal_Bool bInView = IsEntryInView( pEntry ); if( bInView && (!bMoveToTop || pStartEntry == pEntry) ) - return; // ist schon sichtbar + return; // is already visible if( pStartEntry || (m_nStyle & WB_FORCE_MAKEVISIBLE) ) nFlags &= (~F_FILLING); if( !bInView ) { - if( !pView->IsEntryVisible(pEntry) ) // Parent(s) zugeklappt ? + if( !pView->IsEntryVisible(pEntry) ) // Parent(s) collapsed? { SvLBoxEntry* pParent = pView->GetParent( pEntry ); while( pParent ) @@ -996,9 +994,9 @@ void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop ) } pParent = pView->GetParent( pParent ); } - // Passen Children der Parents in View oder muessen wir scrollen ? + // do the parent's children fit into the view or do we have to scroll? if( IsEntryInView( pEntry ) && !bMoveToTop ) - return; // Scrollen nicht noetig -> tschuess + return; // no need to scroll } } @@ -1045,8 +1043,8 @@ void SvImpLBox::DrawNet() !pStartEntry->HasChildren() ) return; - //for platforms who don't have nets, DrawNativeControl does nothing and return true - //so that SvImpLBox::DrawNet() doesn't draw anything too + // for platforms that don't have nets, DrawNativeControl does nothing and returns true + // so that SvImpLBox::DrawNet() doesn't draw anything either if(pView->IsNativeControlSupported( CTRL_LISTNET, PART_ENTIRE_CONTROL)) { ImplControlValue aControlValue; Point aTemp(0,0); // temporary needed for g++ 3.3.5 @@ -1096,8 +1094,8 @@ void SvImpLBox::DrawNet() if( pView->IsExpanded(pEntry) ) { aPos1.X() = pView->GetTabPos(pEntry, pFirstDynamicTab); - // wenn keine ContextBitmap, dann etwas nach rechts - // unter den ersten Text (Node.Bmp ebenfalls + // if it is not a context bitmap, go a little to the right below the + // first text (node bitmap, too) if( !pView->nContextBmpWidthMax ) aPos1.X() += rExpandedNodeBitmap.GetSizePixel().Width() / 2; @@ -1113,16 +1111,16 @@ void SvImpLBox::DrawNet() aPos2.Y() += nDistance * nEntryHeight; pView->DrawLine( aPos1, aPos2 ); } - // Sichtbar im Control ? + // visible in control? if( n>= nOffs && ((m_nStyle & WB_HASLINESATROOT) || !pTree->IsAtRootDepth(pEntry))) { - // kann aPos1 recyclet werden ? + // can we recycle aPos1? if( !pView->IsExpanded(pEntry) ) { - // njet + // nope aPos1.X() = pView->GetTabPos(pEntry, pFirstDynamicTab); - // wenn keine ContextBitmap, dann etwas nach rechts - // unter den ersten Text (Node.Bmp ebenfalls + // if it is not a context bitmap, go a little to the right below + // the first text (node bitmap, too) if( !pView->nContextBmpWidthMax ) aPos1.X() += rExpandedNodeBitmap.GetSizePixel().Width() / 2; aPos1.Y() = nY; @@ -1140,8 +1138,8 @@ void SvImpLBox::DrawNet() { pEntry = pView->First(); aPos1.X() = pView->GetTabPos( pEntry, pFirstDynamicTab); - // wenn keine ContextBitmap, dann etwas nach rechts - // unter den ersten Text (Node.Bmp ebenfalls + // if it is not a context bitmap, go a little to the right below the + // first text (node bitmap, too) if( !pView->nContextBmpWidthMax ) aPos1.X() += rExpandedNodeBitmap.GetSizePixel().Width() / 2; aPos1.X() -= pView->GetIndent(); @@ -1243,13 +1241,13 @@ sal_uInt16 SvImpLBox::AdjustScrollBars( Size& rSize ) (nVis < nMostRight || nMaxRight < nMostRight) )) bHorBar = sal_True; - // Anzahl aller nicht eingeklappten Eintraege + // number of entries that are not collapsed sal_uLong nTotalCount = pView->GetVisibleCount(); - // Anzahl in der View sichtbarer Eintraege + // number of entries visible within the view nVisibleCount = aOSize.Height() / nEntryHeight; - // muessen wir eine vertikale Scrollbar einblenden? + // do we need a vertical scrollbar? if( bVerSBar || nTotalCount > nVisibleCount ) { nResult = 1; @@ -1263,15 +1261,14 @@ sal_uInt16 SvImpLBox::AdjustScrollBars( Size& rSize ) } } - // muessen wir eine horizontale Scrollbar einblenden? + // do we need a horizontal scrollbar? if( bHorBar ) { nResult |= 0x0002; - // die Anzahl der in der View sichtbaren Eintraege - // muss neu berechnet werden, da die horizontale - // ScrollBar eingeblendet wird + // the number of entries visible within the view has to be recalculated + // because the horizontal scrollbar is now visible. nVisibleCount = (aOSize.Height() - nHorSBarHeight) / nEntryHeight; - // eventuell brauchen wir jetzt doch eine vertikale ScrollBar + // we might actually need a vertical scrollbar now if( !(nResult & 0x0001) && ((nTotalCount > nVisibleCount) || bVerSBar) ) { @@ -1282,14 +1279,14 @@ sal_uInt16 SvImpLBox::AdjustScrollBars( Size& rSize ) PositionScrollBars( aOSize, nResult ); - // Range, VisibleRange usw. anpassen + // adapt Range, VisibleRange etc. - // Output-Size aktualisieren, falls wir scrollen muessen + // refresh output size, in case we have to scroll Rectangle aRect; aRect.SetSize( aOSize ); aSelEng.SetVisibleArea( aRect ); - // Vertikale ScrollBar + // vertical scrollbar long nTemp = (long)nVisibleCount; nTemp--; if( nTemp != aVerSBar.GetVisibleSize() ) @@ -1306,7 +1303,7 @@ sal_uInt16 SvImpLBox::AdjustScrollBars( Size& rSize ) } } - // Horizontale ScrollBar + // horizontal scrollbar nTemp = aHorSBar.GetThumbPos(); aHorSBar.SetVisibleSize( aOSize.Width() ); long nNewThumbPos = aHorSBar.GetThumbPos(); @@ -1375,8 +1372,8 @@ void SvImpLBox::Resize() AdjustScrollBars( aOutputSize ); FillView(); } - // !!!HACK, da in Floating- & Docking-Windows nach Resizes - // die Scrollbars nicht richtig, bzw. ueberhaupt nicht gezeichnet werden + // HACK, as in floating and docked windows the scrollbars might not be drawn + // correctly/not be drawn at all after resizing! if( aHorSBar.IsVisible()) aHorSBar.Invalidate(); if( aVerSBar.IsVisible()) @@ -1402,8 +1399,7 @@ void SvImpLBox::FillView() if( nCurDispEntries < nVisibleCount ) { ShowCursor( sal_False ); - // Fenster fuellen, indem der Thumb schrittweise - // nach oben bewegt wird + // fill window by moving the thumb up incrementally sal_Bool bFound = sal_False; SvLBoxEntry* pTemp = pStartEntry; while( nCurDispEntries < nVisibleCount && pTemp ) @@ -1420,7 +1416,7 @@ void SvImpLBox::FillView() if( bFound ) { aVerSBar.SetThumbPos( nThumb ); - ShowCursor( sal_True ); // Focusrect neu berechnen + ShowCursor( sal_True ); // recalculate focus rectangle pView->Invalidate(); } } @@ -1457,7 +1453,7 @@ void SvImpLBox::ShowVerSBar() long nMaxRight = GetOutputSize().Width(); Point aPos( pView->GetMapMode().GetOrigin() ); - aPos.X() *= -1; // Umrechnung Dokumentkoord. + aPos.X() *= -1; // convert document coordinates nMaxRight = nMaxRight + aPos.X() - 1; if( nMaxRight < nMostRight ) { @@ -1507,7 +1503,7 @@ void SvImpLBox::SyncVerThumb() sal_Bool SvImpLBox::IsEntryInView( SvLBoxEntry* pEntry ) const { - // Parent eingeklappt + // parent collapsed if( !pView->IsEntryVisible(pEntry) ) return sal_False; long nY = GetEntryLine( pEntry ); @@ -1523,7 +1519,7 @@ sal_Bool SvImpLBox::IsEntryInView( SvLBoxEntry* pEntry ) const long SvImpLBox::GetEntryLine( SvLBoxEntry* pEntry ) const { if(!pStartEntry ) - return -1; // unsichtbare Position + return -1; // invisible position long nFirstVisPos = pView->GetVisiblePos( pStartEntry ); long nEntryVisPos = pView->GetVisiblePos( pEntry ); @@ -1536,7 +1532,7 @@ void SvImpLBox::SetEntryHeight( short /* nHeight */ ) { SetNodeBmpYOffset( GetExpandedNodeBmp() ); SetNodeBmpYOffset( GetCollapsedNodeBmp() ); - if(!pView->HasViewData()) // stehen wir im Clear? + if(!pView->HasViewData()) // are we within the Clear? { Size aSize = pView->Control::GetOutputSizePixel(); AdjustScrollBars( aSize ); @@ -1552,7 +1548,7 @@ void SvImpLBox::SetEntryHeight( short /* nHeight */ ) // *********************************************************************** -// Callback-Functions +// Callback Functions // *********************************************************************** void SvImpLBox::EntryExpanded( SvLBoxEntry* pEntry ) @@ -1568,8 +1564,8 @@ void SvImpLBox::EntryExpanded( SvLBoxEntry* pEntry ) FindMostRight( pEntry, 0 ); } aVerSBar.SetRange( Range(0, pView->GetVisibleCount()-1 ) ); - // falls vor dem Thumb expandiert wurde, muss - // die Thumb-Position korrigiert werden. + // if we expanded before the thumb, the thumb's position has to be + // corrected SyncVerThumb(); ShowVerSBar(); ShowCursor( sal_True ); @@ -1608,7 +1604,7 @@ void SvImpLBox::EntryCollapsed( SvLBoxEntry* pEntry ) SyncVerThumb(); ShowVerSBar(); } - // wurde Cursor eingeklappt ? + // has the cursor been collapsed? if( pTree->IsChild( pEntry, pCursor ) ) SetCursor( pEntry ); if( GetUpdateMode() ) @@ -1623,9 +1619,9 @@ void SvImpLBox::CollapsingEntry( SvLBoxEntry* pEntry ) if( !pView->IsEntryVisible( pEntry ) || !pStartEntry ) return; - SelAllDestrAnch( sal_False, sal_True ); // deselectall + SelAllDestrAnch( sal_False, sal_True ); // deselect all - // ist der eingeklappte Parent sichtbar ? + // is the collapsed cursor visible? long nY = GetEntryLine( pEntry ); if( IsLineVisible(nY) ) { @@ -1656,15 +1652,14 @@ void SvImpLBox::SetNodeBmpTabDistance() nNodeBmpTabDistance = -pView->GetIndent(); if( pView->nContextBmpWidthMax ) { - // nur, wenn der erste dynamische Tab zentriert ist - // (setze ich momentan voraus) + // only if the first dynamic tab is centered (we currently assume that) Size aSize = GetExpandedNodeBmp().GetSizePixel(); nNodeBmpTabDistance -= aSize.Width() / 2; } } // -// korrigiert bei SingleSelection den Cursor +// corrects the cursor when using SingleSelection // void SvImpLBox::EntrySelected( SvLBoxEntry* pEntry, sal_Bool bSelect ) { @@ -1694,7 +1689,7 @@ void SvImpLBox::EntrySelected( SvLBoxEntry* pEntry, sal_Bool bSelect ) if( IsLineVisible( nY ) ) { ShowCursor( sal_False ); - pView->PaintEntry1( pEntry, nY, 0xffff ); // wg. ItemsetBrowser SV_LBOXTAB_SHOW_SELECTION ); + pView->PaintEntry1( pEntry, nY, 0xffff ); // because of ItemsetBrowser SV_LBOXTAB_SHOW_SELECTION ); ShowCursor( sal_True ); } } @@ -1707,7 +1702,7 @@ void SvImpLBox::RemovingEntry( SvLBoxEntry* pEntry ) if( !pView->IsEntryVisible( pEntry ) ) { - // wenn Parent eingeklappt, dann tschuess + // if parent is collapsed => bye! nFlags |= F_REMOVED_ENTRY_INVISIBLE; return; } @@ -1740,8 +1735,8 @@ void SvImpLBox::RemovingEntry( SvLBoxEntry* pEntry ) { if( bSimpleTravel ) pView->Select( pCursor, sal_False ); - ShowCursor( sal_False ); // Focus-Rect weg - // NextSibling, weil auch Children des Cursors geloescht werden + ShowCursor( sal_False ); // focus rectangle gone + // NextSibling, because we also delete the children of the cursor pTemp = pView->NextSibling( pCursor ); if( !pTemp ) pTemp = (SvLBoxEntry*)(pView->PrevVisible( pCursor )); @@ -1757,8 +1752,8 @@ void SvImpLBox::RemovingEntry( SvLBoxEntry* pEntry ) } if( GetUpdateMode()) { - // wenns der letzte ist, muss invalidiert werden, damit die Linien - // richtig gezeichnet (in diesem Fall geloescht) werden. + // if it is the last one, we have to invalidate it, so the lines are + // drawn correctly (in this case they're deleted) if( pStartEntry && (pStartEntry != pOldStartEntry || pEntry == (SvLBoxEntry*)pView->GetModel()->Last()) ) { aVerSBar.SetThumbPos( pView->GetVisiblePos( pStartEntry )); @@ -1791,7 +1786,7 @@ void SvImpLBox::EntryRemoved() aVerSBar.SetRange( Range(0, pView->GetVisibleCount()-1 ) ); FillView(); if( pStartEntry ) - // falls ueber dem Thumb geloescht wurde + // if something above the thumb was deleted aVerSBar.SetThumbPos( pView->GetVisiblePos( pStartEntry) ); ShowVerSBar(); @@ -1799,12 +1794,12 @@ void SvImpLBox::EntryRemoved() { if( pView->GetSelectionCount() ) { - // ist ein benachbarter Eintrag selektiert? + // is a neighboring entry selected? SvLBoxEntry* pNextCursor = (SvLBoxEntry*)pView->PrevVisible( pCursor ); if( !pNextCursor || !pView->IsSelected( pNextCursor )) pNextCursor = (SvLBoxEntry*)pView->NextVisible( pCursor ); if( !pNextCursor || !pView->IsSelected( pNextCursor )) - // kein Nachbar selektiert: Ersten selektierten nehmen + // no neighbor selected: use first selected pNextCursor = pView->FirstSelected(); SetCursor( pNextCursor ); MakeVisible( pCursor ); @@ -1850,7 +1845,6 @@ void SvImpLBox::MovingEntry( SvLBoxEntry* pEntry ) void SvImpLBox::EntryMoved( SvLBoxEntry* pEntry ) { - // #97680# -------------- UpdateContextBmpWidthVectorFromMovedEntry( pEntry ); if ( !pStartEntry ) @@ -1862,9 +1856,8 @@ void SvImpLBox::EntryMoved( SvLBoxEntry* pEntry ) sal_uInt16 nFirstPos = (sal_uInt16)pTree->GetAbsPos( pStartEntry ); sal_uInt16 nNewPos = (sal_uInt16)pTree->GetAbsPos( pEntry ); FindMostRight(0); - if( nNewPos < nFirstPos ) //!!!Notloesung + if( nNewPos < nFirstPos ) // HACK! pStartEntry = pEntry; - // #97702# --------------- SyncVerThumb(); if( pEntry == pCursor ) { @@ -1892,7 +1885,7 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry ) { SvLBoxEntry* pParent = (SvLBoxEntry*)pTree->GetParent(pEntry); if( pParent && pTree->GetChildList(pParent)->size() == 1 ) - // Pluszeichen zeichnen + // draw plus sign pTree->InvalidateEntry( pParent ); if( !pView->IsEntryVisible( pEntry ) ) @@ -1903,26 +1896,25 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry ) else DestroyAnchor(); // nFlags &= (~F_DESEL_ALL); -// ShowCursor( sal_False ); // falls sich Cursor nach unten verschiebt +// ShowCursor( sal_False ); // if cursor is moved lower long nY = GetEntryLine( pEntry ); sal_Bool bEntryVisible = IsLineVisible( nY ); if( bEntryVisible ) { - ShowCursor( sal_False ); // falls sich Cursor nach unten verschiebt - nY -= pView->GetEntryHeight(); // wg. Linien + ShowCursor( sal_False ); // if cursor is moved lower + nY -= pView->GetEntryHeight(); // because of lines InvalidateEntriesFrom( nY ); } else if( pStartEntry && nY < GetEntryLine(pStartEntry) ) { - // pruefen, ob die View komplett gefuellt ist. Wenn - // nicht, dann pStartEntry und den Cursor anpassen - // (automatisches scrollen) + // Check if the view is filled completely. If not, then adjust + // pStartEntry and the Cursor (automatic scrolling). sal_uInt16 nLast = (sal_uInt16)(pView->GetVisiblePos( (SvLBoxEntry*)(pView->LastVisible()))); sal_uInt16 nThumb = (sal_uInt16)(pView->GetVisiblePos( pStartEntry )); sal_uInt16 nCurDispEntries = nLast-nThumb+1; if( nCurDispEntries < nVisibleCount ) { - // beim naechsten Paint-Event setzen + // set at the next paint event pStartEntry = 0; SetCursor( 0 ); pView->Invalidate(); @@ -1931,7 +1923,7 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry ) else if( !pStartEntry ) pView->Invalidate(); - // die Linien invalidieren + // invalidate the lines /* if( (bEntryVisible || bPrevEntryVisible) && (m_nStyle & ( WB_HASLINES | WB_HASLINESATROOT )) ) @@ -1950,7 +1942,7 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry ) SetMostRight( pEntry ); aVerSBar.SetRange( Range(0, pView->GetVisibleCount()-1)); - SyncVerThumb(); // falls vor Thumb eingefuegt wurde + SyncVerThumb(); // if something was inserted before the thumb ShowVerSBar(); ShowCursor( sal_True ); if( pStartEntry != pView->First() && (nFlags & F_FILLING) ) @@ -1961,11 +1953,11 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry ) // ******************************************************************** -// Eventhandler +// Event handler // ******************************************************************** -// ****** Steuerung der Controlanimation +// ****** Control the control animation sal_Bool SvImpLBox::ButtonDownCheckCtrl(const MouseEvent& rMEvt, SvLBoxEntry* pEntry, long nY ) @@ -2046,9 +2038,9 @@ sal_Bool SvImpLBox::ButtonUpCheckCtrl( const MouseEvent& rMEvt ) return sal_False; } -// ******* Steuerung Plus/Minus-Button zum Expandieren/Kollabieren +// ******* Control plus/minus button for expanding/collapsing -// sal_False == kein Expand/Collapse-Button getroffen +// sal_False == no expand/collapse button hit sal_Bool SvImpLBox::IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) const { if( !pEntry->HasChildren() && !pEntry->HasChildrenOnDemand() ) @@ -2059,7 +2051,7 @@ sal_Bool SvImpLBox::IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) return sal_False; long nMouseX = rPosPixel.X(); - // in Doc-Koords umrechnen + // convert to document coordinates Point aOrigin( pView->GetMapMode().GetOrigin() ); nMouseX -= aOrigin.X(); @@ -2116,7 +2108,7 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt ) nCurTabPos = FIRST_ENTRY_TAB; nFlags &= (~F_FILLING); pView->GrabFocus(); - // #120417# the entry can still be invalid! + // the entry can still be invalid! if( !pEntry || !pView->GetViewData( pEntry )) return; @@ -2147,13 +2139,13 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt ) pView->pHdlEntry = pEntry; if( pView->DoubleClickHdl() ) { - // falls im Handler der Eintrag geloescht wurde + // if the entry was deleted within the handler pEntry = GetClickedEntry( aPos ); if( !pEntry ) return; if( pEntry != pView->pHdlEntry ) { - // neu selektieren & tschuess + // select anew & bye if( !bSimpleTravel && !aSelEng.IsAlwaysAdding()) SelAllDestrAnch( sal_False, sal_True ); // DeselectAll(); SetCursor( pEntry ); @@ -2166,8 +2158,8 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt ) pView->Collapse( pEntry ); else pView->Expand( pEntry ); - if( pEntry == pCursor ) // nur wenn Entryitem angeklickt wurde - // (Nodebutton ist kein Entryitem!) + if( pEntry == pCursor ) // only if Entryitem was clicked + // (Nodebutton is not an Entryitem!) pView->Select( pCursor, sal_True ); return; } @@ -2213,7 +2205,7 @@ sal_Bool SvImpLBox::KeyInput( const KeyEvent& rKEvt) const KeyCode& rKeyCode = rKEvt.GetKeyCode(); if( rKeyCode.IsMod2() ) - return sal_False; // Alt-Taste nicht auswerten + return sal_False; // don't evaluate Alt key nFlags &= (~F_FILLING); @@ -2298,8 +2290,8 @@ sal_Bool SvImpLBox::KeyInput( const KeyEvent& rKEvt) } } else - KeyDown( sal_False ); // weil ScrollBar-Range evtl. noch - // scrollen erlaubt + KeyDown( sal_False ); // because scrollbar range might still + // allow scrolling break; case KEY_RIGHT: @@ -2430,7 +2422,7 @@ sal_Bool SvImpLBox::KeyInput( const KeyEvent& rKEvt) } } else - KeyDown( sal_False ); // siehe KEY_DOWN + KeyDown( sal_False ); // see also: KEY_DOWN } else bKeyUsed = sal_False; @@ -2537,14 +2529,13 @@ sal_Bool SvImpLBox::KeyInput( const KeyEvent& rKEvt) pView->Collapse( pCursor ); if( bMod1 ) { - // bis zur Root alle Parents einklappen + // collapse all parents until we get to the root SvLBoxEntry* pParentToCollapse = (SvLBoxEntry*)pTree->GetRootLevelParent(pCursor); if( pParentToCollapse ) { sal_uInt16 nRefDepth; - // Sonderbehandlung Explorer: Befindet sich auf der - // Root nur ein Eintrag,dann den Root-Entry nicht - // einklappen + // special case explorer: if the root only has a single + // entry, don't collapse the root entry if( pTree->GetChildList(0)->size() < 2 ) { nRefDepth = 1; @@ -2632,7 +2623,7 @@ sal_Bool SvImpLBox::KeyInput( const KeyEvent& rKEvt) case KEY_TAB: case KEY_DELETE: case KEY_BACKSPACE: - // #105907# must not be handled because this quits dialogs and does other magic things... + // must not be handled because this quits dialogs and does other magic things... // if there are other single keys which should not be handled, they can be added here bKeyUsed = sal_False; break; @@ -2766,8 +2757,8 @@ sal_Bool ImpLBSelEng::SetCursorAtPoint(const Point& rPoint, sal_Bool bDontSelect if( pNewCursor ) { - // bei SimpleTravel wird in SetCursor selektiert und - // der Select-Handler gerufen + // at SimpleTravel, the SetCursor is selected and the select handler is + // called //if( !bDontSelectAtCursor && !pImp->bSimpleTravel ) // pImp->SelectEntry( pNewCursor, sal_True ); pImp->SetCursor( pNewCursor, bDontSelectAtCursor ); @@ -2804,12 +2795,12 @@ void ImpLBSelEng::SelectAtPoint( const Point& rPoint ) void ImpLBSelEng::DeselectAll() { - pImp->SelAllDestrAnch( sal_False, sal_False ); // SelectionEngine nicht resetten! + pImp->SelAllDestrAnch( sal_False, sal_False ); // don't reset SelectionEngine! pImp->nFlags &= (~F_DESEL_ALL); } // *********************************************************************** -// Selektion +// Selection // *********************************************************************** void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCursor) @@ -2873,7 +2864,7 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs } else { - if( nNewVisPos < nOldVisPos ) // Vergroessern der Selektion + if( nNewVisPos < nOldVisPos ) // enlarge selection { pEntry = pNewCursor; while( pEntry && pEntry != pOldCursor ) @@ -2949,9 +2940,9 @@ void SvImpLBox::SelAllDestrAnch( sal_Bool bSelect, sal_Bool bDestroyAnchor, { pView->Select( pCursor, sal_False ); if( bDestroyAnchor ) - DestroyAnchor(); // Anker loeschen & SelectionEngine zuruecksetzen + DestroyAnchor(); // delete anchor & reset SelectionEngine else - pAnchor = 0; // internen Anker immer loeschen + pAnchor = 0; // always delete internal anchor return; } @@ -2961,7 +2952,7 @@ void SvImpLBox::SelAllDestrAnch( sal_Bool bSelect, sal_Bool bDestroyAnchor, ShowCursor( sal_False ); sal_Bool bUpdate = GetUpdateMode(); - nFlags |= F_IGNORE_SELECT; // EntryInserted soll nix tun + nFlags |= F_IGNORE_SELECT; // EntryInserted should not do anything pEntry = pTree->First(); while( pEntry ) { @@ -2971,7 +2962,7 @@ void SvImpLBox::SelAllDestrAnch( sal_Bool bSelect, sal_Bool bDestroyAnchor, { long nY = GetEntryLine( pEntry ); if( IsLineVisible( nY ) ) - pView->PaintEntry1( pEntry, nY, 0xffff ); // wg. ItemsetBrowser SV_LBOXTAB_SHOW_SELECTION ); + pView->PaintEntry1( pEntry, nY, 0xffff ); // because of ItemsetBrowser SV_LBOXTAB_SHOW_SELECTION ); } } pEntry = pTree->Next( pEntry ); @@ -2979,9 +2970,9 @@ void SvImpLBox::SelAllDestrAnch( sal_Bool bSelect, sal_Bool bDestroyAnchor, nFlags &= ~F_IGNORE_SELECT; if( bDestroyAnchor ) - DestroyAnchor(); // Anker loeschen & SelectionEngine zuruecksetzen + DestroyAnchor(); // delete anchor & reset SelectionEngine else - pAnchor = 0; // internen Anker immer loeschen + pAnchor = 0; // always delete internal anchor ShowCursor( sal_True ); } @@ -3076,7 +3067,7 @@ void SvImpLBox::Command( const CommandEvent& rCEvt ) if( nCommand == COMMAND_CONTEXTMENU ) aEditTimer.Stop(); - // Rollmaus-Event? + // scroll mouse event? if( ( ( nCommand == COMMAND_WHEEL ) || ( nCommand == COMMAND_STARTAUTOSCROLL ) || ( nCommand == COMMAND_AUTOSCROLL ) ) && pView->HandleScrollCommand( rCEvt, &aHorSBar, &aVerSBar ) ) return; @@ -3088,7 +3079,7 @@ void SvImpLBox::Command( const CommandEvent& rCEvt ) std::stack<SvLBoxEntry*> aSelRestore; if( rCEvt.IsMouseEvent() ) - { // change selection, if mouse pos doesn't fit to selection + { // change selection, if mouse position doesn't fit to selection aPopupPos = rCEvt.GetMousePosPixel(); @@ -3113,7 +3104,7 @@ void SvImpLBox::Command( const CommandEvent& rCEvt ) } } else if( aSelEng.GetSelectionMode() == SINGLE_SELECTION ) - {//modified by BerryJia for fixing Bug102739 2002-9-9 17:00(Beijing Time) + { bClickedIsFreePlace = sal_True; sal_Int32 nSelectedEntries = pView->GetSelectionCount(); SvLBoxEntry* pSelected = pView->FirstSelected(); @@ -3136,7 +3127,7 @@ void SvImpLBox::Command( const CommandEvent& rCEvt ) sal_Int32 nSelectionCount = pView->GetSelectionCount(); if( nSelectionCount ) - { // now allways take first visible as base for positioning the menu + { // now always take first visible as base for positioning the menu SvLBoxEntry* pSelected = pView->FirstSelected(); while( pSelected ) { @@ -3170,7 +3161,7 @@ void SvImpLBox::Command( const CommandEvent& rCEvt ) lcl_DeleteSubPopups(pPopup); delete pPopup; } - //added by BerryJia for fixing Bug102739 2002-9-9 17:00(Beijing Time) + if( bClickedIsFreePlace ) { while(!aSelRestore.empty()) @@ -3283,7 +3274,7 @@ sal_Bool SvImpLBox::RequestHelp( const HelpEvent& rHEvt ) SvLBoxEntry* pEntry = GetEntry( aPos ); if( pEntry ) { - // Rechteck des Textes berechnen + // recalculate text rectangle SvLBoxTab* pTab; SvLBoxString* pItem = (SvLBoxString*)(pView->GetItem( pEntry, aPos.X(), &pTab )); if( !pItem || pItem->IsA() != SV_ITEM_ID_LBOXSTRING ) @@ -3294,7 +3285,7 @@ sal_Bool SvImpLBox::RequestHelp( const HelpEvent& rHEvt ) Size aSize( pItem->GetSize( pView, pEntry ) ); SvLBoxTab* pNextTab = NextTab( pTab ); sal_Bool bItemClipped = sal_False; - // wurde das Item von seinem rechten Nachbarn abgeschnitten? + // is the item cut off by its right neighbor? if( pNextTab && pView->GetTabPos(pEntry,pNextTab) < aPos.X()+aSize.Width() ) { aSize.Width() = pNextTab->GetPos() - pTab->GetPos(); @@ -3306,7 +3297,7 @@ sal_Bool SvImpLBox::RequestHelp( const HelpEvent& rHEvt ) if( bItemClipped || !aViewRect.IsInside( aItemRect ) ) { - // rechten Item-Rand am View-Rand clippen + // clip the right edge of the item at the edge of the view //if( aItemRect.Right() > aViewRect.Right() ) // aItemRect.Right() = aViewRect.Right(); @@ -3382,7 +3373,7 @@ sal_Bool SvImpLBox::SetMostRight( SvLBoxEntry* pEntry ) long nMaxRight = GetOutputSize().Width(); Point aPos( pView->GetMapMode().GetOrigin() ); - aPos.X() *= -1; // Umrechnung Dokumentkoord. + aPos.X() *= -1; // conversion document coordinates nMaxRight = nMaxRight + aPos.X() - 1; long nNextTab = nTabPos < nMaxRight ? nMaxRight : nMaxRight + 50; diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx index 18adbefe0604..54241b5c37a2 100644 --- a/svtools/source/contnr/svlbitm.cxx +++ b/svtools/source/contnr/svlbitm.cxx @@ -478,7 +478,7 @@ void SvLBoxButton::ImplAdjustBoxSize( Size& io_rSize, ControlType i_eType, Windo if( bNativeOK ) { Size aContentSize( aNativeContent.GetSize() ); - // leave a little space around the box image (looks better + // leave a little space around the box image (looks better) if( aContentSize.Height() + 2 > io_rSize.Height() ) io_rSize.Height() = aContentSize.Height() + 2; } diff --git a/svtools/source/contnr/svlbox.cxx b/svtools/source/contnr/svlbox.cxx index f212136fabb9..22a2c9583ad0 100644 --- a/svtools/source/contnr/svlbox.cxx +++ b/svtools/source/contnr/svlbox.cxx @@ -28,9 +28,9 @@ /* - Todo: - - Anker loeschen in SelectionEngine bei manuellem Selektieren - - SelectAll( sal_False ), nur die deselektierten Entries repainten + TODO: + - delete anchor in SelectionEngine when selecting manually + - SelectAll( sal_False ) => only repaint the delselected entries */ #include <string.h> @@ -328,15 +328,15 @@ long SvLBoxTab::CalcOffset( long nItemWidth, long nTabWidth ) { if( nFlags & SV_LBOXTAB_FORCE ) { - //richtige Implementierung der Zentrierung + // correct implementation of centering nOffset = ( nTabWidth - nItemWidth ) / 2; if( nOffset < 0 ) nOffset = 0; } else { - // historisch gewachsene falsche Berechnung des Tabs, auf die sich - // Abo-Tabbox, Extras/Optionen/Anpassen etc. verlassen + // historically grown, wrong calculation of tabs which is needed by + // Abo-Tabbox, Tools/Options/Customize etc. nItemWidth++; nOffset = -( nItemWidth / 2 ); } @@ -562,7 +562,7 @@ SvLBox::SvLBox( Window* pParent, WinBits nWinStyle ) : pModel->InsertView( this ); pHdlEntry = 0; pEdCtrl = 0; - SetSelectionMode( SINGLE_SELECTION ); // pruefen ob TreeListBox gecallt wird + SetSelectionMode( SINGLE_SELECTION ); // check if TreeListBox is called SetDragDropMode( SV_DRAGDROP_NONE ); SetType(WINDOW_TREELISTBOX); } @@ -612,7 +612,7 @@ SvLBox::~SvLBox() void SvLBox::SetModel( SvLBoxTreeList* pNewModel ) { DBG_CHKTHIS(SvLBox,0); - // erledigt das ganz CleanUp + // does the CleanUp SvListView::SetModel( pNewModel ); pModel->SetCloneLink( LINK(this, SvLBox, CloneHdl_Impl )); SvLBoxEntry* pEntry = First(); @@ -634,7 +634,7 @@ void SvLBox::DisconnectFromModel() void SvLBox::Clear() { DBG_CHKTHIS(SvLBox,0); - pModel->Clear(); // Model ruft SvLBox::ModelHasCleared() auf + pModel->Clear(); // Model calls SvLBox::ModelHasCleared() } void SvLBox::EnableEntryMnemonics( bool _bEnable ) @@ -716,31 +716,31 @@ sal_Bool SvLBox::CheckDragAndDropMode( SvLBox* pSource, sal_Int8 nAction ) if ( pSource == this ) { if ( !(nDragDropMode & (SV_DRAGDROP_CTRL_MOVE | SV_DRAGDROP_CTRL_COPY) ) ) - return sal_False; // D&D innerhalb der Liste gesperrt + return sal_False; // D&D locked within list if( DND_ACTION_MOVE == nAction ) { if ( !(nDragDropMode & SV_DRAGDROP_CTRL_MOVE) ) - return sal_False; // kein lokales Move + return sal_False; // no local move } else { if ( !(nDragDropMode & SV_DRAGDROP_CTRL_COPY)) - return sal_False; // kein lokales Copy + return sal_False; // no local copy } } else { if ( !(nDragDropMode & SV_DRAGDROP_APP_DROP ) ) - return sal_False; // kein Drop + return sal_False; // no drop if ( DND_ACTION_MOVE == nAction ) { if ( !(nDragDropMode & SV_DRAGDROP_APP_MOVE) ) - return sal_False; // kein globales Move + return sal_False; // no global move } else { if ( !(nDragDropMode & SV_DRAGDROP_APP_COPY)) - return sal_False; // kein globales Copy + return sal_False; // no global copy } } return sal_True; @@ -758,30 +758,30 @@ void SvLBox::NotifyRemoving( SvLBoxEntry* ) NotifyMoving/Copying ==================== - Standard-Verhalten: + default behavior: - 1. Target hat keine Children - - Entry wird Sibling des Targets. Entry steht hinter dem - Target (->Fenster: Unter dem Target) - 2. Target ist ein aufgeklappter Parent - - Entry wird an den Anfang der Target-Childlist gehaengt - 3. Target ist ein zugeklappter Parent - - Entry wird an das Ende der Target-Childlist gehaengt + 1. target doesn't have children + - entry becomes sibling of target. entry comes after target + (->Window: below the target) + 2. target is an expanded parent + - entry inserted at the beginning of the target childlist + 3. target is a collapsed parent + - entry is inserted at the end of the target childlist */ #ifdef DBG_UTIL sal_Bool SvLBox::NotifyMoving( - SvLBoxEntry* pTarget, // D&D-Drop-Position in this->GetModel() - SvLBoxEntry* pEntry, // Zu verschiebender Entry aus + SvLBoxEntry* pTarget, // D&D dropping position in this->GetModel() + SvLBoxEntry* pEntry, // entry that we want to move, from // GetSourceListBox()->GetModel() - SvLBoxEntry*& rpNewParent, // Neuer Target-Parent - sal_uLong& rNewChildPos) // Position in Childlist des Target-Parents + SvLBoxEntry*& rpNewParent, // new target parent + sal_uLong& rNewChildPos) // position in childlist of target parent #else sal_Bool SvLBox::NotifyMoving( - SvLBoxEntry* pTarget, // D&D-Drop-Position in this->GetModel() - SvLBoxEntry*, // Zu verschiebender Entry aus + SvLBoxEntry* pTarget, // D&D dropping position in this->GetModel() + SvLBoxEntry*, // entry that we want to move, from // GetSourceListBox()->GetModel() - SvLBoxEntry*& rpNewParent, // Neuer Target-Parent - sal_uLong& rNewChildPos) // Position in Childlist des Target-Parents + SvLBoxEntry*& rpNewParent, // new target parent + sal_uLong& rNewChildPos) // position in childlist of target parent #endif { DBG_CHKTHIS(SvLBox,0); @@ -794,7 +794,7 @@ sal_Bool SvLBox::NotifyMoving( } if ( !pTarget->HasChildren() && !pTarget->HasChildrenOnDemand() ) { - // Fall 1 + // case 1 rpNewParent = GetParent( pTarget ); rNewChildPos = pModel->GetRelPos( pTarget ) + 1; rNewChildPos += nCurEntrySelPos; @@ -802,7 +802,7 @@ sal_Bool SvLBox::NotifyMoving( } else { - // Faelle 2 & 3 + // cases 2 & 3 rpNewParent = pTarget; if( IsExpanded(pTarget)) rNewChildPos = 0; @@ -813,11 +813,11 @@ sal_Bool SvLBox::NotifyMoving( } sal_Bool SvLBox::NotifyCopying( - SvLBoxEntry* pTarget, // D&D-Drop-Position in this->GetModel() - SvLBoxEntry* pEntry, // Zu kopierender Entry aus + SvLBoxEntry* pTarget, // D&D dropping position in this->GetModel() + SvLBoxEntry* pEntry, // entry that we want to move, from // GetSourceListBox()->GetModel() - SvLBoxEntry*& rpNewParent, // Neuer Target-Parent - sal_uLong& rNewChildPos) // Position in Childlist des Target-Parents + SvLBoxEntry*& rpNewParent, // new target parent + sal_uLong& rNewChildPos) // position in childlist of target parent { DBG_CHKTHIS(SvLBox,0); return NotifyMoving(pTarget,pEntry,rpNewParent,rNewChildPos); @@ -857,24 +857,23 @@ SvLBoxEntry* SvLBox::CloneEntry( SvLBoxEntry* pSource ) } -// Rueckgabe: Alle Entries wurden kopiert +// return: all entries copied sal_Bool SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget ) { DBG_CHKTHIS(SvLBox,0); - nCurEntrySelPos = 0; // Selektionszaehler fuer NotifyMoving/Copying + nCurEntrySelPos = 0; // selection counter for NotifyMoving/Copying sal_Bool bSuccess = sal_True; SvTreeEntryList aList; sal_Bool bClone = (sal_Bool)( (sal_uLong)(pSource->GetModel()) != (sal_uLong)GetModel() ); Link aCloneLink( pModel->GetCloneLink() ); pModel->SetCloneLink( LINK(this, SvLBox, CloneHdl_Impl )); - // Selektion zwischenspeichern, um bei D&D-Austausch - // innerhalb der gleichen Listbox das Iterieren ueber - // die Selektion zu vereinfachen + // cache selection to simplify iterating over the selection when doing a D&D + // exchange within the same listbox SvLBoxEntry* pSourceEntry = pSource->FirstSelected(); while ( pSourceEntry ) { - // Children werden automatisch mitkopiert + // children are copied automatically pSource->SelectChildren( pSourceEntry, sal_False ); aList.push_back( pSourceEntry ); pSourceEntry = pSource->NextSelected( pSourceEntry ); @@ -906,7 +905,7 @@ sal_Bool SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget ) else bSuccess = sal_False; - if( bOk == (sal_Bool)2 ) // !!!HACK verschobenen Entry sichtbar machen? + if( bOk == (sal_Bool)2 ) // HACK: make visible moved entry? MakeVisible( pSourceEntry ); pSourceEntry = (SvLBoxEntry*)aList.Next(); @@ -915,7 +914,7 @@ sal_Bool SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget ) return bSuccess; } -// Rueckgabe: Alle Entries wurden verschoben +// return: all entries were moved sal_Bool SvLBox::MoveSelection( SvLBox* pSource, SvLBoxEntry* pTarget ) { return MoveSelectionCopyFallbackPossible( pSource, pTarget, sal_False ); @@ -924,7 +923,7 @@ sal_Bool SvLBox::MoveSelection( SvLBox* pSource, SvLBoxEntry* pTarget ) sal_Bool SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pTarget, sal_Bool bAllowCopyFallback ) { DBG_CHKTHIS(SvLBox,0); - nCurEntrySelPos = 0; // Selektionszaehler fuer NotifyMoving/Copying + nCurEntrySelPos = 0; // selection counter for NotifyMoving/Copying sal_Bool bSuccess = sal_True; SvTreeEntryList aList; sal_Bool bClone = (sal_Bool)( (sal_uLong)(pSource->GetModel()) != (sal_uLong)GetModel() ); @@ -935,7 +934,7 @@ sal_Bool SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry SvLBoxEntry* pSourceEntry = pSource->FirstSelected(); while ( pSourceEntry ) { - // Children werden automatisch mitbewegt + // children are automatically moved pSource->SelectChildren( pSourceEntry, sal_False ); aList.push_back( pSourceEntry ); pSourceEntry = pSource->NextSelected( pSourceEntry ); @@ -977,7 +976,7 @@ sal_Bool SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry else bSuccess = sal_False; - if( bOk == (sal_Bool)2 ) // !!!HACK verschobenen Entry sichtbar machen? + if( bOk == (sal_Bool)2 ) // HACK: make moved entry visible? MakeVisible( pSourceEntry ); pSourceEntry = (SvLBoxEntry*)aList.Next(); @@ -990,14 +989,14 @@ void SvLBox::RemoveSelection() { DBG_CHKTHIS(SvLBox,0); SvTreeEntryList aList; - // Selektion zwischenspeichern, da die Impl bei - // dem ersten Remove alles deselektiert! + // cache selection, as the implementation deselects everything on the first + // remove SvLBoxEntry* pEntry = FirstSelected(); while ( pEntry ) { aList.push_back( pEntry ); if ( pEntry->HasChildren() ) - // Remove loescht Children automatisch + // remove deletes all children automatically SelectChildren( pEntry, sal_False ); pEntry = NextSelected( pEntry ); } @@ -1204,7 +1203,7 @@ void SvLBox::InitViewData( SvViewData* pData, SvListEntry* pEntry ) pEntryData->pItemData = new SvViewDataItem[ pInhEntry->ItemCount() ]; SvViewDataItem* pItemData = pEntryData->pItemData; - pEntryData->nItmCnt = pInhEntry->ItemCount(); // Anzahl Items fuer delete + pEntryData->nItmCnt = pInhEntry->ItemCount(); // number of items to delete sal_uInt16 nCount = pInhEntry->ItemCount(); sal_uInt16 nCurPos = 0; while( nCurPos < nCount ) @@ -1293,7 +1292,7 @@ void SvLBox::EditText( const String& rStr, const Rectangle& rRect, IMPL_LINK_NOARG(SvLBox, TextEditEndedHdl_Impl) { DBG_CHKTHIS(SvLBox,0); - if ( nImpFlags & SVLBOX_EDTEND_CALLED ) // Nesting verhindern + if ( nImpFlags & SVLBOX_EDTEND_CALLED ) // avoid nesting return 0; nImpFlags |= SVLBOX_EDTEND_CALLED; String aStr; @@ -1303,9 +1302,9 @@ IMPL_LINK_NOARG(SvLBox, TextEditEndedHdl_Impl) aStr = pEdCtrl->GetSavedValue(); if ( IsEmptyTextAllowed() || aStr.Len() > 0 ) EditedText( aStr ); - // Hide darf erst gerufen werden, nachdem der neue Text in den - // Entry gesetzt wurde, damit im GetFocus der ListBox nicht - // der Selecthandler mit dem alten EntryText gerufen wird. + // Hide may only be called after the new text was put into the entry, so + // that we don't call the selection handler in the GetFocus of the listbox + // with the old entry text. pEdCtrl->Hide(); // delete pEdCtrl; // pEdCtrl = 0; @@ -1555,7 +1554,7 @@ sal_Int8 SvLBox::AcceptDrop( const AcceptDropEvent& rEvt ) } } - // **** Emphasis zeichnen **** + // **** draw emphasis **** if( DND_ACTION_NONE == nRet ) ImplShowTargetEmphasis( pTargetEntry, sal_False ); else if( pEntry != pTargetEntry || !(nImpFlags & SVLBOX_TARGEMPH_VIS) ) @@ -1599,7 +1598,7 @@ sal_Int8 SvLBox::ExecuteDrop( const ExecuteDropEvent& rEvt, SvLBox* pSourceView ReadDragServerInfo( rEvt.maPosPixel, &aDDInfo ); - SvLBoxEntry* pTarget = pTargetEntry; // !!! kann 0 sein !!! + SvLBoxEntry* pTarget = pTargetEntry; // may be 0! if( DND_ACTION_COPY == rEvt.mnAction ) { @@ -1664,7 +1663,7 @@ void SvLBox::StartDrag( sal_Int8, const Point& rPosPixel ) aDDInfo.pApp = GetpApp(); aDDInfo.pSource = this; aDDInfo.pDDStartEntry = pEntry; - // abgeleitete Views zum Zuge kommen lassen + // let derived views do their thing WriteDragServerInfo( rPosPixel, &aDDInfo ); pContainer->CopyAnyData( SOT_FORMATSTR_ID_TREELISTBOX, @@ -1677,10 +1676,9 @@ void SvLBox::StartDrag( sal_Int8, const Point& rPosPixel ) Update(); Control::SetUpdateMode( bOldUpdateMode ); - // Selektion & deren Children im Model als DropTargets sperren - // Wichtig: Wenn im DropHandler die Selektion der - // SourceListBox veraendert wird, muessen vorher die Eintraege - // als DropTargets wieder freigeschaltet werden: + // Disallow using the selection and its children as drop targets. + // Important: If the selection of the SourceListBox is changed in the + // DropHandler, the entries have to be allowed as drop targets again: // (GetSourceListBox()->EnableSelectionAsDropTarget( sal_True, sal_True );) EnableSelectionAsDropTarget( sal_False, sal_True /* with children */ ); @@ -1723,7 +1721,7 @@ sal_Bool SvLBox::NotifyAcceptDrop( SvLBoxEntry* ) return sal_True; } -// handler and methods for Drag - finished handler. +// Handler and methods for Drag - finished handler. // The with get GetDragFinishedHdl() get link can set on the // TransferDataContainer. This link is a callback for the DragFinished // call. AddBox method is called from the GetDragFinishedHdl() and the diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx index f2c54a7b43bc..3f839bf8d644 100644 --- a/svtools/source/contnr/svtabbx.cxx +++ b/svtools/source/contnr/svtabbx.cxx @@ -40,7 +40,7 @@ using namespace ::com::sun::star::accessibility; #define MYTABMASK \ ( SV_LBOXTAB_ADJUST_RIGHT | SV_LBOXTAB_ADJUST_LEFT | SV_LBOXTAB_ADJUST_CENTER | SV_LBOXTAB_ADJUST_NUMERIC ) -// SvTreeListBox-Callback +// SvTreeListBox callback void SvTabListBox::SetTabs() { @@ -49,16 +49,16 @@ void SvTabListBox::SetTabs() { DBG_ASSERT(pTabList,"TabList ?"); - // die TreeListBox hat jetzt ihre Tabulatoren in die Liste eingefuegt. - // jetzt plustern wir die Liste mit zusaetzlichen Tabulatoren auf, - // und passen den ganz rechten Tab der Treelistbox an. + // The tree listbox has now inserted its tabs into the list. Now we + // fluff up the list with additional tabs and adjust the rightmost tab + // of the tree listbox. - // den ganz rechten Tab nehmen - // HACK fuer den Explorer! Wenn der ViewParent != 0 ist, dann wird - // der erste Tab der TreeListBox von der TreelistBox berechnet! - // Dies wird fuer ButtonsOnRoot benoetigt, da der Explorer nicht - // weiss, welchen zusaetzlichen Offset er in diesem Modus auf - // den Tabulator addieren muss. Die TreeListBox weiss es! + // Picking the rightmost tab. + // HACK for the explorer! If ViewParent != 0, the first tab of the tree + // listbox is calculated by the tre listbox itself! This behavior is + // necessary for ButtonsOnRoot, as the explorer does not know in this + // case, which additional offset it need to add to the tabs in this mode + // -- the tree listbox knows that, though! /* if( !pViewParent ) { @@ -69,7 +69,7 @@ void SvTabListBox::SetTabs() } */ - // alle anderen Tabs an Liste haengen + // append all other tabs to the list for( sal_uInt16 nCurTab = 1; nCurTab < nTabCount; nCurTab++ ) { SvLBoxTab* pTab = pTabList+nCurTab; @@ -112,7 +112,7 @@ SvTabListBox::SvTabListBox( Window* pParent, WinBits nBits ) pTabList = 0; nTabCount = 0; pViewParent = 0; - SetHighlightRange(); // ueber volle Breite selektieren + SetHighlightRange(); // select full width } SvTabListBox::SvTabListBox( Window* pParent, const ResId& rResId ) @@ -127,7 +127,7 @@ SvTabListBox::SvTabListBox( Window* pParent, const ResId& rResId ) SvTabListBox::~SvTabListBox() { - // array-delete + // delete array delete [] pTabList; #ifdef DBG_UTIL pTabList = 0; @@ -341,7 +341,7 @@ void SvTabListBox::SetEntryText( const XubString& rStr, SvLBoxEntry* pEntry, sal if( pCurToken ) aTemp = XubString( pCurToken, nCurTokenLen ); else - aTemp.Erase(); // alle Spalten ohne Token loeschen + aTemp.Erase(); // delete all columns without a token ((SvLBoxString*)pStr)->SetText( pEntry, aTemp ); pCurToken = pNextToken; pNextToken = GetToken( pCurToken, nCurTokenLen ); @@ -435,7 +435,7 @@ const xub_Unicode* SvTabListBox::GetToken( const xub_Unicode* pPtr, sal_uInt16& c = *pPtr; } if( c ) - pPtr++; // Tab ueberspringen + pPtr++; // skip tab else pPtr = 0; rLen = nLen; diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx index f55233d0ebb4..ae7f599b75c1 100644 --- a/svtools/source/contnr/svtreebx.cxx +++ b/svtools/source/contnr/svtreebx.cxx @@ -44,11 +44,10 @@ class TabBar; using namespace ::com::sun::star::accessibility; /* - Bugs/ToDo + Bugs/TODO - - Berechnung Rectangle beim Inplace-Editing (Bug bei manchen Fonts) - - SetSpaceBetweenEntries: Offset wird in SetEntryHeight nicht - beruecksichtigt + - calculate rectangle when editing in-place (bug with some fonts) + - SetSpaceBetweenEntries: offset is not taken into account in SetEntryHeight */ #define TREEFLAG_FIXEDHEIGHT 0x0010 @@ -166,17 +165,17 @@ void SvTreeListBox::Resize() pImp->ShowCursor( sal_True ); } -/* Faelle: +/* Cases: - A) Entries haben Bitmaps - 0. Keine Buttons - 1. Node-Buttons (optional auch an Root-Items) - 2. Node-Buttons (optional auch an Root-Items) + CheckButton + A) entries have bitmaps + 0. no buttons + 1. node buttons (can optionally also be on root items) + 2. node buttons (can optionally also be on root items) + CheckButton 3. CheckButton - B) Entries haben keine Bitmaps (->ueber WindowBits wg. D&D !!!!!!) - 0. Keine Buttons - 1. Node-Buttons (optional auch an Root-Items) - 2. Node-Buttons (optional auch an Root-Items) + CheckButton + B) entries don't have bitmaps (=>via WindowBits because of D&D!) + 0. no buttons + 1. node buttons (can optionally also be on root items) + 2. node buttons (can optionally also be on root items) + CheckButton 3. CheckButton */ @@ -198,7 +197,7 @@ void SvTreeListBox::Resize() #define TAB_STARTPOS 2 -// bei Aenderungen GetTextOffset beruecksichtigen +// take care of GetTextOffset when doing changes void SvTreeListBox::SetTabs() { DBG_CHKTHIS(SvTreeListBox,0); @@ -240,12 +239,12 @@ void SvTreeListBox::SetTabs() switch( nCase ) { case NO_BUTTONS : - nStartPos += nContextWidthDIV2; // wg. Zentrierung + nStartPos += nContextWidthDIV2; // because of centering AddTab( nStartPos, TABFLAGS_CONTEXTBMP ); - nStartPos += nContextWidthDIV2; // rechter Rand der Context-Bmp - // Abstand setzen nur wenn Bitmaps da + nStartPos += nContextWidthDIV2; // right edge of context bitmap + // only set a distance if there are bitmaps if( nContextBmpWidthMax ) - nStartPos += 5; // Abstand Context-Bmp - Text + nStartPos += 5; // distance context bitmap to text AddTab( nStartPos, TABFLAGS_TEXT ); break; @@ -255,10 +254,10 @@ void SvTreeListBox::SetTabs() else nStartPos += nContextWidthDIV2; AddTab( nStartPos, TABFLAGS_CONTEXTBMP ); - nStartPos += nContextWidthDIV2; // rechter Rand der Context-Bmp - // Abstand setzen nur wenn Bitmaps da + nStartPos += nContextWidthDIV2; // right edge of context bitmap + // only set a distance if there are bitmaps if( nContextBmpWidthMax ) - nStartPos += 5; // Abstand Context-Bmp - Text + nStartPos += 5; // distance context bitmap to text AddTab( nStartPos, TABFLAGS_TEXT ); break; @@ -268,28 +267,28 @@ void SvTreeListBox::SetTabs() else nStartPos += nCheckWidthDIV2; AddTab( nStartPos, TABFLAGS_CHECKBTN ); - nStartPos += nCheckWidthDIV2; // rechter Rand des CheckButtons - nStartPos += 3; // Abstand CheckButton Context-Bmp - nStartPos += nContextWidthDIV2; // Mitte der Context-Bmp + nStartPos += nCheckWidthDIV2; // right edge of CheckButton + nStartPos += 3; // distance CheckButton to context bitmap + nStartPos += nContextWidthDIV2; // center of context bitmap AddTab( nStartPos, TABFLAGS_CONTEXTBMP ); - nStartPos += nContextWidthDIV2; // rechter Rand der Context-Bmp - // Abstand setzen nur wenn Bitmaps da + nStartPos += nContextWidthDIV2; // right edge of context bitmap + // only set a distance if there are bitmaps if( nContextBmpWidthMax ) - nStartPos += 5; // Abstand Context-Bmp - Text + nStartPos += 5; // distance context bitmap to text AddTab( nStartPos, TABFLAGS_TEXT ); break; case CHECK_BUTTONS : nStartPos += nCheckWidthDIV2; AddTab( nStartPos, TABFLAGS_CHECKBTN ); - nStartPos += nCheckWidthDIV2; // rechter Rand CheckButton - nStartPos += 3; // Abstand CheckButton Context-Bmp - nStartPos += nContextWidthDIV2; // Mitte der Context-Bmp + nStartPos += nCheckWidthDIV2; // right edge of CheckButton + nStartPos += 3; // distance CheckButton to context bitmap + nStartPos += nContextWidthDIV2; // center of context bitmap AddTab( nStartPos, TABFLAGS_CONTEXTBMP ); - nStartPos += nContextWidthDIV2; // rechter Rand der Context-Bmp - // Abstand setzen nur wenn Bitmaps da + nStartPos += nContextWidthDIV2; // right edge of context bitmap + // only set a distance if there are bitmaps if( nContextBmpWidthMax ) - nStartPos += 5; // Abstand Context-Bmp - Text + nStartPos += 5; // distance context bitmap to text AddTab( nStartPos, TABFLAGS_TEXT ); break; } @@ -574,11 +573,10 @@ void SvTreeListBox::CheckButtonHdl() } // -// TODO: Momentan werden die Daten so geklont, dass sie dem -// Standard-TreeView-Format entsprechen. Hier sollte eigentlich -// das Model als Referenz dienen. Dies fuehrt dazu, dass -// SvLBoxEntry::Clone _nicht_ gerufen wird, sondern nur dessen -// Basisklasse SvListEntry +// TODO: Currently all data is cloned so that they conform to the default tree +// view format. Actually, the model should be used as a reference here. This +// leads to us _not_ calling SvLBoxEntry::Clone, but only its base class +// SvListEntry. // SvLBoxEntry* SvTreeListBox::CloneEntry( SvLBoxEntry* pSource ) @@ -715,7 +713,7 @@ void SvTreeListBox::EnableInplaceEditing( sal_Bool bOn ) void SvTreeListBox::KeyInput( const KeyEvent& rKEvt ) { DBG_CHKTHIS(SvTreeListBox,0); - // unter OS/2 bekommen wir auch beim Editieren Key-Up/Down + // under OS/2, we get key up/down even while editing if( IsEditingActive() ) return; @@ -771,7 +769,7 @@ void SvTreeListBox::LoseFocus() void SvTreeListBox::ModelHasCleared() { DBG_CHKTHIS(SvTreeListBox,0); - pImp->pCursor = 0; //sonst Absturz beim Inplace-Editieren im GetFocus + pImp->pCursor = 0; // else we crash in GetFocus when editing in-place delete pEdCtrl; pEdCtrl = NULL; pImp->Clear(); @@ -808,7 +806,7 @@ void SvTreeListBox::ScrollOutputArea( short nDeltaEntries ) NotifyBeginScroll(); if( nDeltaEntries < 0 ) { - // das Fenster nach oben verschieben + // move window up nDeltaEntries *= -1; long nVis = pImp->aVerSBar.GetVisibleSize(); long nTemp = nThumb + nVis; @@ -960,7 +958,7 @@ sal_Bool SvTreeListBox::Expand( SvLBoxEntry* pParent ) nFlags = pParent->GetFlags(); nFlags |= SV_ENTRYFLAG_NO_NODEBMP; pParent->SetFlags( nFlags ); - GetModel()->InvalidateEntry( pParent ); // neu zeichnen + GetModel()->InvalidateEntry( pParent ); // repaint } // #i92103# @@ -1041,8 +1039,8 @@ void SvTreeListBox::SelectAll( sal_Bool bSelect, sal_Bool ) DBG_CHKTHIS(SvTreeListBox,0); pImp->SelAllDestrAnch( bSelect, - sal_True, // Anker loeschen, - sal_True ); // auch bei SINGLE_SELECTION den Cursor deselektieren + sal_True, // delete anchor, + sal_True ); // even when using SINGLE_SELECTION, deselect the cursor } void SvTreeListBox::ModelHasInsertedTree( SvListEntry* pEntry ) @@ -1119,8 +1117,7 @@ void SvTreeListBox::SetFont( const Font& rFont ) aTempFont.SetTransparent( sal_True ); Control::SetFont( aTempFont ); AdjustEntryHeight( aTempFont ); - // immer Invalidieren, sonst fallen wir - // bei SetEntryHeight auf die Nase + // always invalidate, else things go wrong in SetEntryHeight RecalcViewData(); } @@ -1213,9 +1210,9 @@ void SvTreeListBox::MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop ) void SvTreeListBox::ModelHasEntryInvalidated( SvListEntry* pEntry ) { DBG_CHKTHIS(SvTreeListBox,0); - // die einzelnen Items des Entries reinitialisieren + // reinitialize the separate items of the entries SvLBox::ModelHasEntryInvalidated( pEntry ); - // repainten + // repaint pImp->InvalidateEntry( (SvLBoxEntry*)pEntry ); } @@ -1252,7 +1249,7 @@ void SvTreeListBox::EditItemText( SvLBoxEntry* pEntry, SvLBoxString* pItem, aSize.Width() = nRight - aPos.X(); } Point aOrigin( GetMapMode().GetOrigin() ); - aPos += aOrigin; // in Win-Koord umrechnen + aPos += aOrigin; // convert to win coordinates aSize.Width() -= aOrigin.X(); Rectangle aRect( aPos, aSize ); EditText( pItem->GetText(), aRect, rSelection ); @@ -1365,7 +1362,7 @@ void SvTreeListBox::EditingRequest( SvLBoxEntry* pEntry, SvLBoxItem* pItem, SvLBoxEntry* SvTreeListBox::GetDropTarget( const Point& rPos ) { DBG_CHKTHIS(SvTreeListBox,0); - // Scrollen + // scroll if( rPos.Y() < 12 ) { SvLBox::ImplShowTargetEmphasis( SvLBox::pTargetEntry, sal_False ); @@ -1382,7 +1379,7 @@ SvLBoxEntry* SvTreeListBox::GetDropTarget( const Point& rPos ) } SvLBoxEntry* pTarget = pImp->GetEntry( rPos ); - // bei Droppen in leere Flaeche -> den letzten Eintrag nehmen + // when dropping in a vacant space, use the last entry if( !pTarget ) return (SvLBoxEntry*)LastVisible(); else if( (GetDragDropMode() & SV_DRAGDROP_ENABLE_TOP) && @@ -1478,13 +1475,13 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,sal_uInt16 nTabFl short nTempEntryHeight = GetEntryHeight(); long nWidth = pImp->GetOutputSize().Width(); - // wurde innerhalb des PreparePaints die horizontale ScrollBar - // angeschaltet? Wenn ja, muss die ClipRegion neu gesetzt werden + // Did we turn on the scrollbar within PreparePaints? If yes, we have to set + // the ClipRegion anew. if( !bHorSBar && pImp->HasHorScrollBar() ) SetClipRegion( Region(pImp->GetClipRegionRect()) ); Point aEntryPos( GetMapMode().GetOrigin() ); - aEntryPos.X() *= -1; // Umrechnung Dokumentkoord. + aEntryPos.X() *= -1; // conversion document coordinates long nMaxRight = nWidth + aEntryPos.X() - 1; Color aBackupTextColor( GetTextColor() ); @@ -1493,8 +1490,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,sal_uInt16 nTabFl bool bCurFontIsSel = false; sal_Bool bInUse = pEntry->HasInUseEmphasis(); - // wenn eine ClipRegion von aussen gesetzt wird, dann - // diese nicht zuruecksetzen + // if a ClipRegion was set from outside, we don't have to reset it const WinBits nWindowStyle = GetStyle(); const sal_Bool bResetClipRegion = !bHasClipRegion; const sal_Bool bHideSelection = ((nWindowStyle & WB_HIDESELECTION) && !HasFocus())!=0; @@ -1542,7 +1538,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,sal_uInt16 nTabFl long nX; if( pTab->nFlags & SV_LBOXTAB_ADJUST_RIGHT ) - //verhindern, das rechter Rand von der Tabtrennung abgeschnitten wird + // avoid cutting the right edge off the tab separation nX = nTabPos + pTab->CalcOffset(aSize.Width(), (nNextTabPos-SV_TAB_BORDER-1) -nTabPos); else nX = nTabPos + pTab->CalcOffset(aSize.Width(), nNextTabPos-nTabPos); @@ -1557,7 +1553,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,sal_uInt16 nTabFl aEntryPos.X() = nX; aEntryPos.Y() = nLine; - // Hintergrund-Muster & Farbe bestimmen + // set background pattern/color Wallpaper aWallpaper = GetBackground(); @@ -1584,7 +1580,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,sal_uInt16 nTabFl } aWallpaper.SetColor( aNewWallColor ); } - else // keine Selektion + else // no selection { if( bInUse && nItemType == SV_ITEM_ID_LBOXCONTEXTBMP ) aWallpaper.SetColor( rSettings.GetFieldColor() ); @@ -1596,22 +1592,22 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,sal_uInt16 nTabFl } } - // Hintergrund zeichnen + // draw background if( !(nTreeFlags & TREEFLAG_USESEL)) { - // nur den Bereich zeichnen, den das Item einnimmt + // only draw the area that is used by the item aRectSize.Width() = aSize.Width(); aRect.SetPos( aEntryPos ); aRect.SetSize( aRectSize ); } else { - // vom aktuellen bis zum naechsten Tab zeichnen + // draw from the current to the next tab if( nCurTab != 0 ) aRect.Left() = nTabPos; else - // beim nullten Tab immer ab Spalte 0 zeichnen - // (sonst Probleme bei Tabs mit Zentrierung) + // if we're in the 0th tab, always draw from column 0 -- + // else we get problems with centered tabs aRect.Left() = 0; aRect.Top() = nLine; aRect.Bottom() = nLine + nTempEntryHeight - 1; @@ -1626,25 +1622,24 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,sal_uInt16 nTabFl else aRect.Right() = nMaxRight; } - // bei anwenderdefinierter Selektion, die bei einer Tabposition - // groesser 0 beginnt den Hintergrund des 0.ten Items nicht - // fuellen, da sonst z.B. TablistBoxen mit Linien nicht - // realisiert werden koennen. + // A custom selection that starts at a tab position > 0, do not fill + // the background of the 0th item, else e.g. we might not be able to + // realize tab listboxes with lines. if( !(nCurTab==0 && (nTreeFlags & TREEFLAG_USESEL) && nFirstSelTab) ) { SetFillColor( aWallpaper.GetColor() ); - // Bei kleinen hor. Resizes tritt dieser Fall auf + // this case may occur for smaller horizontal resizes if( aRect.Left() < aRect.Right() ) DrawRect( aRect ); } - // Item zeichnen - // vertikal zentrieren + // draw item + // center vertically aEntryPos.Y() += ( nTempEntryHeight - aSize.Height() ) / 2; pItem->Paint( aEntryPos, *this, pViewDataEntry->GetFlags(), pEntry ); - // Trennungslinie zwischen Tabs + // division line between tabs if( pNextTab && pItem->IsA() == SV_ITEM_ID_LBOXSTRING && - // nicht am rechten Fensterrand! + // not at the right edge of the window! aRect.Right() < nMaxRight ) { aRect.Left() = aRect.Right() - SV_TAB_BORDER; @@ -1658,7 +1653,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,sal_uInt16 nTabFl } if( pViewDataEntry->IsCursored() && !HasFocus() ) { - // Cursor-Emphasis + // cursor emphasis SetFillColor(); Color aOldLineColor = GetLineColor(); SetLineColor( Color( COL_BLACK ) ); @@ -1681,15 +1676,14 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,sal_uInt16 nTabFl long nDynTabPos = GetTabPos( pEntry, pFirstDynamicTab ); nDynTabPos += pImp->nNodeBmpTabDistance; nDynTabPos += pImp->nNodeBmpWidth / 2; - nDynTabPos += 4; // 4 Pixel Reserve, damit die Node-Bitmap - // nicht zu nah am naechsten Tab steht + nDynTabPos += 4; // 4 pixels of buffer, so the node bitmap is not too close + // to the next tab if( (!(pEntry->GetFlags() & SV_ENTRYFLAG_NO_NODEBMP)) && (nWindowStyle & WB_HASBUTTONS) && pFirstDynamicTab && ( pEntry->HasChildren() || pEntry->HasChildrenOnDemand() ) ) { - // ersten festen Tab suchen, und pruefen ob die Node-Bitmap - // in ihn hineinragt + // find first tab and check if the node bitmap extends into it sal_uInt16 nNextTab = nFirstDynTabPos; SvLBoxTab* pNextTab; do @@ -1808,10 +1802,10 @@ Rectangle SvTreeListBox::GetFocusRect( SvLBoxEntry* pEntry, long nLine ) if( !aSize.Width() ) aSize.Width() = 15; long nX = nTabPos; //GetTabPos( pEntry, pTab ); - // Ausrichtung + // alignment nX += pTab->CalcOffset( aSize.Width(), nNextTabPos - nTabPos ); aRect.Left() = nX; - // damit erster & letzter Buchstabe nicht angeknabbert werden + // make sure that first and last letter aren't cut off slightly aRect.SetSize( aSize ); if( aRect.Left() > 0 ) aRect.Left()--; @@ -1820,16 +1814,16 @@ Rectangle SvTreeListBox::GetFocusRect( SvLBoxEntry* pEntry, long nLine ) } else { - // wenn erster SelTab != 0, dann muessen wir auch rechnen + // if SelTab != 0, we have to calculate also if( nFocusWidth == -1 || nFirstSelTab ) { sal_uInt16 nLastTab; SvLBoxTab* pLastTab = GetLastTab(SV_LBOXTAB_SHOW_SELECTION,nLastTab); nLastTab++; - if( nLastTab < aTabs.Count() ) // gibts noch einen ? + if( nLastTab < aTabs.Count() ) // is there another one? pLastTab = (SvLBoxTab*)aTabs.GetObject( nLastTab ); else - pLastTab = 0; // ueber gesamte Breite selektieren + pLastTab = 0; // select whole width aSize.Width() = pLastTab ? pLastTab->GetPos() : 0x0fffffff; nFocusWidth = (short)aSize.Width(); if( pTab ) @@ -1843,10 +1837,10 @@ Rectangle SvTreeListBox::GetFocusRect( SvLBoxEntry* pEntry, long nLine ) if( nCurTab ) aSize.Width() += nTabPos; else - aSize.Width() += pTab->GetPos(); // Tab0 immer ab ganz links + aSize.Width() += pTab->GetPos(); // Tab0 always from the leftmost position } } - // wenn Sel. beim nullten Tab anfaengt, dann ab Spalte 0 sel. zeichnen + // if selection starts with 0th tab, draw from column 0 on if( nCurTab != 0 ) { aRect.Left() = nTabPos; @@ -1854,7 +1848,7 @@ Rectangle SvTreeListBox::GetFocusRect( SvLBoxEntry* pEntry, long nLine ) } aRect.SetSize( aSize ); } - // rechten Rand anpassen wg. Clipping + // adjust right edge because of clipping if( aRect.Right() >= nRealWidth ) { aRect.Right() = nRealWidth-1; @@ -1963,8 +1957,8 @@ void SvTreeListBox::AddTab(long nTabPos,sal_uInt16 nFlags,void* pUserData ) if( nPos >= nFirstSelTab && nPos <= nLastSelTab ) pTab->nFlags |= SV_LBOXTAB_SHOW_SELECTION; else - // String-Items werden normalerweise immer selektiert - // deshalb explizit ausschalten + // string items usually have to be selected -- turn this off + // explicitly pTab->nFlags &= ~SV_LBOXTAB_SHOW_SELECTION; } } @@ -2053,7 +2047,8 @@ void SvTreeListBox::Invalidate( sal_uInt16 nInvalidateFlags ) { DBG_CHKTHIS(SvTreeListBox,0); if( nFocusWidth == -1 ) - // damit Control nicht nach dem Paint ein falsches FocusRect anzeigt + // to make sure that the control doesn't show the wrong focus rectangle + // after painting pImp->RecalcFocusRect(); NotifyInvalidating(); SvLBox::Invalidate( nInvalidateFlags ); @@ -2064,7 +2059,8 @@ void SvTreeListBox::Invalidate( const Rectangle& rRect, sal_uInt16 nInvalidateFl { DBG_CHKTHIS(SvTreeListBox,0); if( nFocusWidth == -1 ) - // damit Control nicht nach dem Paint ein falsches FocusRect anzeigt + // to make sure that the control doesn't show the wrong focus rectangle + // after painting pImp->RecalcFocusRect(); NotifyInvalidating(); SvLBox::Invalidate( rRect, nInvalidateFlags ); @@ -2083,7 +2079,7 @@ void SvTreeListBox::SetHighlightRange( sal_uInt16 nStart, sal_uInt16 nEnd) nStart = nEnd; nEnd = nTemp; } - // alle Tabs markieren, die im Bereich liegen + // select all tabs that lie within the area nTreeFlags |= TREEFLAG_RECALCTABS; nFirstSelTab = nStart; nLastSelTab = nEnd; @@ -2234,8 +2230,7 @@ void SvTreeListBox::ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry break; case LISTACTION_RESORTED: - // nach Sortierung den ersten Eintrag anzeigen, dabei die - // Selektion erhalten. + // after a selection: show first entry and also keep the selection MakeVisible( (SvLBoxEntry*)pModel->First(), sal_True ); SetUpdateMode( sal_True ); break; diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx index a6ad1efed705..655cdb5db89e 100644 --- a/svtools/source/contnr/treelist.cxx +++ b/svtools/source/contnr/treelist.cxx @@ -213,7 +213,7 @@ void SvTreeList::RemoveView( SvListView* pView ) } -// Ein Entry ist sichtbar, wenn alle Parents expandiert sind +// an entry is visible if all parents are expanded sal_Bool SvTreeList::IsEntryVisible( const SvListView* pView, SvListEntry* pEntry ) const { DBG_ASSERT(pView&&pEntry,"IsVisible:Invalid Params"); @@ -300,7 +300,7 @@ sal_Bool SvTreeList::IsChild( SvListEntry* pParent, SvListEntry* pChild ) const sal_uLong SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,sal_uLong nListPos) { - // pDest darf Null sein! + // pDest may be 0! DBG_ASSERT(pSrcEntry,"Entry?"); if ( !pTargetParent ) pTargetParent = pRootItem; @@ -318,30 +318,30 @@ sal_uLong SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,sal SvTreeEntryList* pDstList = pTargetParent->pChildren; SvTreeEntryList* pSrcList = pSrcEntry->pParent->pChildren; - // Dummy-Ptr einfuegen, weil nListPos durch das - // folgende Remove ungueltig werden koennte + // insert dummy pointer, as nListPos might become invalid because of the + // following Remove. SvListEntry* pDummy = 0; pDstList->insert( pDummy, nListPos ); - // loeschen + // delete pSrcList->remove( pSrcEntry ); - // Hat Parent noch Children ? + // does parent still have children? if ( pSrcList->empty() ) { - // Keine Children, deshalb Child-List loeschen + // no children, thus delete child list SvListEntry* pParent = pSrcEntry->pParent; pParent->pChildren = 0; delete pSrcList; pSrcList = 0; } - // Parent umsetzen (erst hier, weil wir zum Loeschen - // der ChildList den alten Parent noch benoetigen!) + // move parent umsetzen (do this only now, because we need the parent for + // deleting the old child list!) pSrcEntry->pParent = pTargetParent; pDstList->replace( pSrcEntry, pDummy ); - // Listenpositionen in Zielliste korrigieren + // correct list position in target list SetListPositions( pDstList ); if ( pSrcList && (sal_uLong)pSrcList != (sal_uLong)pDstList ) SetListPositions( pSrcList ); @@ -358,7 +358,7 @@ sal_uLong SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,sal sal_uLong SvTreeList::Copy(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,sal_uLong nListPos) { - // pDest darf Null sein! + // pDest may be 0! DBG_ASSERT(pSrcEntry,"Entry?"); if ( !pTargetParent ) pTargetParent = pRootItem; @@ -372,9 +372,9 @@ sal_uLong SvTreeList::Copy(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,sal nEntryCount += nCloneCount; SvTreeEntryList* pDstList = pTargetParent->pChildren; - pClonedEntry->pParent = pTargetParent; // Parent umsetzen - pDstList->insert( pClonedEntry, nListPos ); // Einfuegen - SetListPositions( pDstList ); // Listenpositionen in Zielliste korrigieren + pClonedEntry->pParent = pTargetParent; // move parent + pDstList->insert( pClonedEntry, nListPos ); // insert + SetListPositions( pDstList ); // correct list position in target list #ifdef CHECK_INTEGRITY CheckIntegrity(); @@ -406,7 +406,7 @@ void SvTreeList::Move( SvListEntry* pSrcEntry, SvListEntry* pDstEntry ) { pParent = pDstEntry->pParent; nPos = pDstEntry->GetChildListPos(); - nPos++; // UNTER (Bildschirm) pDstEntry einfuegen + nPos++; // (On screen:) insert _below_ pDstEntry } Move( pSrcEntry, pParent, nPos ); } @@ -423,17 +423,17 @@ void SvTreeList::InsertTree(SvListEntry* pSrcEntry, if ( !pTargetParent->pChildren ) pTargetParent->pChildren = new SvTreeEntryList; - // Sortierung beruecksichtigen + // take sorting into account GetInsertionPos( pSrcEntry, pTargetParent, nListPos ); bAbsPositionsValid = sal_False; - pSrcEntry->pParent = pTargetParent; // Parent umsetzen + pSrcEntry->pParent = pTargetParent; // move parent SvTreeEntryList* pDstList = pTargetParent->pChildren; - pDstList->insert( pSrcEntry, nListPos ); // einfuegen - SetListPositions(pDstList); // Listenpositionen in Zielliste korrigieren + pDstList->insert( pSrcEntry, nListPos ); // insert + SetListPositions(pDstList); // correct list position in target list nEntryCount += GetChildCount( pSrcEntry ); - nEntryCount++; // der Parent ist ja auch neu + nEntryCount++; // the parent is new, too #ifdef CHECK_INTEGRITY CheckIntegrity(); @@ -730,7 +730,7 @@ sal_uLong SvTreeList::GetVisiblePos( const SvListView* pView, SvListEntry* pEntr if ( !pView->bVisPositionsValid ) { - // damit GetVisibleCount die Positionen aktualisiert + // to make GetVisibleCount refresh the positions ((SvListView*)pView)->nVisibleCount = 0; GetVisibleCount( const_cast<SvListView*>(pView) ); } @@ -753,7 +753,7 @@ sal_uLong SvTreeList::GetVisibleCount( SvListView* pView ) const return pView->nVisibleCount; sal_uLong nPos = 0; - SvListEntry* pEntry = First(); // erster Eintrag immer sichtbar + SvListEntry* pEntry = First(); // first entry is always visible while ( pEntry ) { SvViewData* pViewData = pView->GetViewData( pEntry ); @@ -779,8 +779,8 @@ sal_uLong SvTreeList::GetVisibleCount( SvListView* pView ) const |* *************************************************************************/ -// Funktion geht aus Geschwindigkeitsgruenden davon aus, -// das der uebergebene Eintrag bereits sichtbar ist +// For performance reasons, this function assumes that the passed entry is +// already visible. SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pActEntry,sal_uInt16* pActDepth) const { @@ -845,8 +845,8 @@ SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pActEn |* *************************************************************************/ -// Funktion geht aus Geschwindigkeitsgruenden davon aus, -// das der uebergebene Eintrag bereits sichtbar ist +// For performance reasons, this function assumes that the passed entry is +// already visible. SvListEntry* SvTreeList::PrevVisible(const SvListView* pView, SvListEntry* pActEntry, sal_uInt16* pActDepth) const { @@ -919,8 +919,8 @@ SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pEntry DBG_ASSERT(pView&&pEntry&&IsEntryVisible(pView,pEntry),"NextVis:Wrong Prms/!Vis"); sal_uLong nVisPos = GetVisiblePos( pView, pEntry ); - // nDelta Eintraege vorhanden ? - // Beispiel: 0,1,2,3,4,5,6,7,8,9 nVisPos=5 nDelta=7 + // nDelta entries existent? + // example: 0,1,2,3,4,5,6,7,8,9 nVisPos=5 nDelta=7 // nNewDelta = 10-nVisPos-1 == 4 if ( nVisPos+nDelta >= pView->nVisibleCount ) { @@ -948,8 +948,8 @@ SvListEntry* SvTreeList::PrevVisible( const SvListView* pView, SvListEntry* pEnt DBG_ASSERT(pView&&pEntry&&IsEntryVisible(pView,pEntry),"PrevVis:Parms/!Vis"); sal_uLong nVisPos = GetVisiblePos( pView, pEntry ); - // nDelta Eintraege vorhanden ? - // Beispiel: 0,1,2,3,4,5,6,7,8,9 nVisPos=8 nDelta=20 + // nDelta entries existent? + // example: 0,1,2,3,4,5,6,7,8,9 nVisPos=8 nDelta=20 // nNewDelta = nNewVisPos if ( nDelta > nVisPos ) nDelta = (sal_uInt16)nVisPos; @@ -1096,12 +1096,12 @@ sal_uLong SvTreeList::Insert( SvListEntry* pEntry,SvListEntry* pParent,sal_uLong SvTreeEntryList* pList = pParent->pChildren; if ( !pList ) { - // Parent bekommt zum erstenmal ein Kind + // parent gets the first child pList = new SvTreeEntryList; pParent->pChildren = pList; } - // Sortierung beruecksichtigen + // take sorting into account GetInsertionPos( pEntry, pParent, nPos ); bAbsPositionsValid = sal_False; @@ -1174,7 +1174,7 @@ void SvTreeList::Expand( SvListView* pView, SvListEntry* pEntry ) SvViewData* pViewData = pView->GetViewData(pEntry); pViewData->nFlags |= SVLISTENTRYFLAG_EXPANDED; SvListEntry* pParent = pEntry->pParent; - // wenn Parent sichtbar dann Statusdaten invalidieren + // if parent is visible, invalidate status data if ( pView->IsExpanded( pParent ) ) { pView->bVisPositionsValid = sal_False; @@ -1262,10 +1262,9 @@ sal_Bool SvTreeList::Remove( SvListEntry* pEntry ) if( !pEntry->pParent ) { OSL_FAIL("Removing entry not in model!"); - // unter gewissen Umstaenden (welche?) loescht der - // Explorer aus der View Eintraege, die er nicht in die View - // eingefuegt hat. Da sich der Kunde fuer ein platzendes - // Office nichts kaufen kann, fange ich diesen Fall ab. + // Under certain circumstances (which?), the explorer deletes entries + // from the view that it hasn't inserted into the view. We don't want + // to crash, so we catch this case here. return sal_False; } @@ -1310,7 +1309,7 @@ sal_Bool SvTreeList::Remove( SvListEntry* pEntry ) #endif Broadcast( LISTACTION_REMOVED, pEntry ); - delete pEntry; // loescht auch alle Children + delete pEntry; // deletes any children as well return sal_True; } @@ -1402,7 +1401,7 @@ SvListEntry* SvTreeList::GetRootLevelParent( SvListEntry* pEntry ) const { pCurParent = pEntry->pParent; if ( pCurParent == pRootItem ) - return pEntry; // ist sein eigener Parent + return pEntry; // is its own parent while( pCurParent && pCurParent->pParent != pRootItem ) pCurParent = pCurParent->pParent; } @@ -1448,21 +1447,21 @@ void SvListView::InitTable() if( maDataTable.size() ) { DBG_ASSERT(maDataTable.size()==1,"InitTable: TableCount != 1"); - // die im Clear fuer die Root allozierten View-Daten loeschen - // Achtung: Das zu dem RootEntry (und damit auch der Entry) - // gehoerende Model kann bereits geloescht sein! + // Delete the view data allocated to the Clear in the root. + // Attention: The model belonging to the root entry (and thus the entry + // itself) might already be deleted. maDataTable.clear(); } SvListEntry* pEntry; SvViewData* pViewData; - // RootEntry einfuegen + // insert root entry pEntry = pModel->pRootItem; pViewData = new SvViewData; pViewData->nFlags = SVLISTENTRYFLAG_EXPANDED; maDataTable.insert( pEntry, pViewData ); - // Jetzt alle anderen Entries + // now all the other entries pEntry = pModel->First(); while( pEntry ) { @@ -1494,7 +1493,7 @@ void SvListView::Clear() bVisPositionsValid = sal_False; if( pModel ) { - // RootEntry einfuegen + // insert root entry SvListEntry* pEntry = pModel->pRootItem; SvViewData* pViewData = new SvViewData; pViewData->nFlags = SVLISTENTRYFLAG_EXPANDED; @@ -1614,7 +1613,7 @@ void SvListView::ActionInsertedTree( SvListEntry* pEntry ) nVisibleCount = 0; bVisPositionsValid = sal_False; } - // ueber Entry und seine Children iterieren + // iterate over entry and its children SvListEntry* pCurEntry = pEntry; sal_uInt16 nRefDepth = pModel->GetDepth( pCurEntry ); while( pCurEntry ) @@ -1728,12 +1727,12 @@ void SvListView::ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry1, break; case LISTACTION_CLEARING: ActionClear(); - ModelHasCleared(); //sic! wg. Kompatibilitaet! + ModelHasCleared(); // sic! for compatibility reasons! break; case LISTACTION_CLEARED: break; case LISTACTION_INVALIDATE_ENTRY: - // keine Action fuer die Basisklasse + // no action for the base class ModelHasEntryInvalidated( pEntry1 ); break; case LISTACTION_RESORTED: @@ -1830,10 +1829,10 @@ void SvTreeList::GetInsertionPos( SvListEntry* pEntry, SvListEntry* pParent, if( eCompare != COMPARE_EQUAL ) { - if(i > ((long)pChildList->size() - 1)) // nicht gefunden, Ende der Liste + if(i > ((long)pChildList->size() - 1)) // not found, end of list rPos = ULONG_MAX; else - rPos = i; // nicht gefunden, Mitte + rPos = i; // not found, middle of list } else rPos = k; |