Kaydet (Commit) 85dc0919 authored tarafından Sebastian Spaeth's avatar Sebastian Spaeth

Various code cleanup and translations

Translate some German comments, do some minor code cleanup and
simplify one function a bit.
üst f0d9c4aa
...@@ -67,12 +67,11 @@ using namespace ::com::sun::star; ...@@ -67,12 +67,11 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
long nVirtToolBoxHeight; // wird im WatchWindow init., im Stackwindow verw. long nVirtToolBoxHeight; // inited in WatchWindow, used in Stackwindow
long nHeaderBarHeight; long nHeaderBarHeight;
#define SCROLL_LINE 12 #define SCROLL_LINE 12
#define SCROLL_PAGE 60 #define SCROLL_PAGE 60
#define DWBORDER 3 #define DWBORDER 3
static const char cSuffixes[] = "%&!#@$"; static const char cSuffixes[] = "%&!#@$";
...@@ -80,9 +79,12 @@ static const char cSuffixes[] = "%&!#@$"; ...@@ -80,9 +79,12 @@ static const char cSuffixes[] = "%&!#@$";
MapUnit eEditMapUnit = MAP_100TH_MM; MapUnit eEditMapUnit = MAP_100TH_MM;
// #108672 Helper functions to get/set text in TextEngine /**
// using the stream interface (get/setText() only supports * Helper functions to get/set text in TextEngine using
// tools Strings limited to 64K). * the stream interface.
*
* get/setText() only supports tools Strings limited to 64K).
*/
::rtl::OUString getTextEngineText( ExtTextEngine* pEngine ) ::rtl::OUString getTextEngineText( ExtTextEngine* pEngine )
{ {
SvMemoryStream aMemStream; SvMemoryStream aMemStream;
...@@ -108,20 +110,19 @@ void setTextEngineText( ExtTextEngine* pEngine, const ::rtl::OUString aStr ) ...@@ -108,20 +110,19 @@ void setTextEngineText( ExtTextEngine* pEngine, const ::rtl::OUString aStr )
void lcl_DrawIDEWindowFrame( DockingWindow* pWin ) void lcl_DrawIDEWindowFrame( DockingWindow* pWin )
{ {
// The result of using explicit colors here appears to be harmless when if ( pWin->IsFloatingMode() )
// switching to high contrast mode: return;
if ( !pWin->IsFloatingMode() )
{ Size aSz = pWin->GetOutputSizePixel();
Size aSz = pWin->GetOutputSizePixel(); const Color aOldLineColor( pWin->GetLineColor() );
const Color aOldLineColor( pWin->GetLineColor() ); pWin->SetLineColor( Color( COL_WHITE ) );
pWin->SetLineColor( Color( COL_WHITE ) ); // White line on top
// oben eine weisse.. pWin->DrawLine( Point( 0, 0 ), Point( aSz.Width(), 0 ) );
pWin->DrawLine( Point( 0, 0 ), Point( aSz.Width(), 0 ) ); // Black line at bottom
// unten eine schwarze... pWin->SetLineColor( Color( COL_BLACK ) );
pWin->SetLineColor( Color( COL_BLACK ) ); pWin->DrawLine( Point( 0, aSz.Height() - 1 ),
pWin->DrawLine( Point( 0, aSz.Height() - 1 ), Point( aSz.Width(), aSz.Height() - 1 ) ); Point( aSz.Width(), aSz.Height() - 1 ) );
pWin->SetLineColor( aOldLineColor ); pWin->SetLineColor( aOldLineColor );
}
} }
void lcl_SeparateNameAndIndex( const String& rVName, String& rVar, String& rIndex ) void lcl_SeparateNameAndIndex( const String& rVName, String& rVar, String& rIndex )
...@@ -190,7 +191,6 @@ __EXPORT EditorWindow::~EditorWindow() ...@@ -190,7 +191,6 @@ __EXPORT EditorWindow::~EditorWindow()
{ {
EndListening( *pEditEngine ); EndListening( *pEditEngine );
pEditEngine->RemoveView( pEditView ); pEditEngine->RemoveView( pEditView );
// pEditEngine->SetViewWin( 0 );
delete pEditView; delete pEditView;
delete pEditEngine; delete pEditEngine;
} }
...@@ -230,12 +230,12 @@ String EditorWindow::GetWordAtCursor() ...@@ -230,12 +230,12 @@ String EditorWindow::GetWordAtCursor()
nEnd = nLength; nEnd = nLength;
} }
// Nicht den Selektierten Bereich, sondern an der CursorPosition, // Not the selected range, but at the CursorPosition,
// falls Teil eines Worts markiert. // if a word is partially selected.
if ( !aWord.Len() ) if ( !aWord.Len() )
aWord = pTextEngine->GetWord( rSelEnd ); aWord = pTextEngine->GetWord( rSelEnd );
// Kann leer sein, wenn komplettes Word markiert, da Cursor dahinter. // Can be empty when full word selected, as Cursor behing it
if ( !aWord.Len() && pEditView->HasSelection() ) if ( !aWord.Len() && pEditView->HasSelection() )
aWord = pTextEngine->GetWord( rSelStart ); aWord = pTextEngine->GetWord( rSelStart );
} }
...@@ -248,7 +248,7 @@ void __EXPORT EditorWindow::RequestHelp( const HelpEvent& rHEvt ) ...@@ -248,7 +248,7 @@ void __EXPORT EditorWindow::RequestHelp( const HelpEvent& rHEvt )
{ {
BOOL bDone = FALSE; BOOL bDone = FALSE;
// Sollte eigentlich mal aktiviert werden... // Should have been activated at some point
if ( pEditEngine ) if ( pEditEngine )
{ {
if ( rHEvt.GetMode() & HELPMODE_CONTEXT ) if ( rHEvt.GetMode() & HELPMODE_CONTEXT )
...@@ -316,11 +316,11 @@ void __EXPORT EditorWindow::RequestHelp( const HelpEvent& rHEvt ) ...@@ -316,11 +316,11 @@ void __EXPORT EditorWindow::RequestHelp( const HelpEvent& rHEvt )
void __EXPORT EditorWindow::Resize() void __EXPORT EditorWindow::Resize()
{ {
// ScrollBars, etc. passiert in Adjust... // ScrollBars, etc. happens in Adjust...
if ( pEditView ) if ( pEditView )
{ {
long nVisY = pEditView->GetStartDocPos().Y(); long nVisY = pEditView->GetStartDocPos().Y();
// pEditView->SetOutputArea( Rectangle( Point( 0, 0 ), GetOutputSize() ) );
pEditView->ShowCursor(); pEditView->ShowCursor();
Size aOutSz( GetOutputSizePixel() ); Size aOutSz( GetOutputSizePixel() );
long nMaxVisAreaStart = pEditView->GetTextEngine()->GetTextHeight() - aOutSz.Height(); long nMaxVisAreaStart = pEditView->GetTextEngine()->GetTextHeight() - aOutSz.Height();
...@@ -341,7 +341,6 @@ void __EXPORT EditorWindow::Resize() ...@@ -341,7 +341,6 @@ void __EXPORT EditorWindow::Resize()
} }
void __EXPORT EditorWindow::MouseMove( const MouseEvent &rEvt ) void __EXPORT EditorWindow::MouseMove( const MouseEvent &rEvt )
{ {
if ( pEditView ) if ( pEditView )
...@@ -349,7 +348,6 @@ void __EXPORT EditorWindow::MouseMove( const MouseEvent &rEvt ) ...@@ -349,7 +348,6 @@ void __EXPORT EditorWindow::MouseMove( const MouseEvent &rEvt )
} }
void __EXPORT EditorWindow::MouseButtonUp( const MouseEvent &rEvt ) void __EXPORT EditorWindow::MouseButtonUp( const MouseEvent &rEvt )
{ {
if ( pEditView ) if ( pEditView )
...@@ -389,10 +387,8 @@ BOOL EditorWindow::ImpCanModify() ...@@ -389,10 +387,8 @@ BOOL EditorWindow::ImpCanModify()
BOOL bCanModify = TRUE; BOOL bCanModify = TRUE;
if ( StarBASIC::IsRunning() ) if ( StarBASIC::IsRunning() )
{ {
// Wenn im Trace-Mode, entweder Trace abbrechen oder // If in Trace-mode, abort the trace or refuse input
// Eingabe verweigern // Remove markers in the modules in Notify at Basic::Stoped
// Im Notify bei Basic::Stoped die Markierungen in den Modulen
// entfernen!
if ( QueryBox( 0, WB_OK_CANCEL, String( IDEResId( RID_STR_WILLSTOPPRG ) ) ).Execute() == RET_OK ) if ( QueryBox( 0, WB_OK_CANCEL, String( IDEResId( RID_STR_WILLSTOPPRG ) ) ).Execute() == RET_OK )
{ {
pModulWindow->GetBasicStatus().bIsRunning = FALSE; pModulWindow->GetBasicStatus().bIsRunning = FALSE;
...@@ -406,7 +402,7 @@ BOOL EditorWindow::ImpCanModify() ...@@ -406,7 +402,7 @@ BOOL EditorWindow::ImpCanModify()
void __EXPORT EditorWindow::KeyInput( const KeyEvent& rKEvt ) void __EXPORT EditorWindow::KeyInput( const KeyEvent& rKEvt )
{ {
if ( !pEditView ) // Passiert unter W95 bei letzte Version, Ctrl-Tab if ( !pEditView ) // Happens in Win95
return; return;
#if OSL_DEBUG_LEVEL > 1 #if OSL_DEBUG_LEVEL > 1
...@@ -471,7 +467,7 @@ void __EXPORT EditorWindow::KeyInput( const KeyEvent& rKEvt ) ...@@ -471,7 +467,7 @@ void __EXPORT EditorWindow::KeyInput( const KeyEvent& rKEvt )
void __EXPORT EditorWindow::Paint( const Rectangle& rRect ) void __EXPORT EditorWindow::Paint( const Rectangle& rRect )
{ {
if ( !pEditEngine ) // spaetestens jetzt brauche ich sie... if ( !pEditEngine ) // We need it now at latest
CreateEditEngine(); CreateEditEngine();
pEditView->Paint( rRect ); pEditView->Paint( rRect );
...@@ -489,10 +485,10 @@ BOOL EditorWindow::SetSourceInBasic( BOOL bQuiet ) ...@@ -489,10 +485,10 @@ BOOL EditorWindow::SetSourceInBasic( BOOL bQuiet )
BOOL bChanged = FALSE; BOOL bChanged = FALSE;
if ( pEditEngine && pEditEngine->IsModified() if ( pEditEngine && pEditEngine->IsModified()
&& !GetEditView()->IsReadOnly() ) // Added because of #i60626, otherwise && !GetEditView()->IsReadOnly() ) // Added for #i60626, otherwise
// any read only bug in the text engine could lead to a crash later // any read only bug in the text engine could lead to a crash later
{ {
if ( !StarBASIC::IsRunning() ) // Nicht zur Laufzeit! if ( !StarBASIC::IsRunning() ) // Not at runtime!
{ {
::rtl::OUString aModule = getTextEngineText( pEditEngine ); ::rtl::OUString aModule = getTextEngineText( pEditEngine );
...@@ -1708,7 +1704,6 @@ IMPL_LINK( ComplexEditorWindow, ScrollHdl, ScrollBar *, pCurScrollBar ) ...@@ -1708,7 +1704,6 @@ IMPL_LINK( ComplexEditorWindow, ScrollHdl, ScrollBar *, pCurScrollBar )
return 0; return 0;
} }
// virtual
void ComplexEditorWindow::DataChanged(DataChangedEvent const & rDCEvt) void ComplexEditorWindow::DataChanged(DataChangedEvent const & rDCEvt)
{ {
Window::DataChanged(rDCEvt); Window::DataChanged(rDCEvt);
...@@ -1725,7 +1720,6 @@ void ComplexEditorWindow::DataChanged(DataChangedEvent const & rDCEvt) ...@@ -1725,7 +1720,6 @@ void ComplexEditorWindow::DataChanged(DataChangedEvent const & rDCEvt)
} }
} }
// virtual
uno::Reference< awt::XWindowPeer > uno::Reference< awt::XWindowPeer >
EditorWindow::GetComponentInterface(BOOL bCreate) EditorWindow::GetComponentInterface(BOOL bCreate)
{ {
...@@ -1749,7 +1743,7 @@ WatchTreeListBox::WatchTreeListBox( Window* pParent, WinBits nWinBits ) ...@@ -1749,7 +1743,7 @@ WatchTreeListBox::WatchTreeListBox( Window* pParent, WinBits nWinBits )
WatchTreeListBox::~WatchTreeListBox() WatchTreeListBox::~WatchTreeListBox()
{ {
// User-Daten zerstoeren... // Destroy user data
SvLBoxEntry* pEntry = First(); SvLBoxEntry* pEntry = First();
while ( pEntry ) while ( pEntry )
{ {
...@@ -2026,8 +2020,8 @@ BOOL WatchTreeListBox::ImplBasicEntryEdited( SvLBoxEntry* pEntry, const String& ...@@ -2026,8 +2020,8 @@ BOOL WatchTreeListBox::ImplBasicEntryEdited( SvLBoxEntry* pEntry, const String&
UpdateWatches(); UpdateWatches();
// Der Text soll niemals 1-zu-1 uebernommen werden, weil dann das // The text should never be taken/copied 1:1,
// UpdateWatches verlorengeht. // as the UpdateWatches will be lost
return FALSE; return FALSE;
} }
...@@ -2080,7 +2074,6 @@ static String implCreateTypeStringForDimArray( WatchItem* pItem, SbxDataType eTy ...@@ -2080,7 +2074,6 @@ static String implCreateTypeStringForDimArray( WatchItem* pItem, SbxDataType eTy
void implEnableChildren( SvLBoxEntry* pEntry, bool bEnable ) void implEnableChildren( SvLBoxEntry* pEntry, bool bEnable )
// inline void implEnableChildren( SvLBoxEntry* pEntry, bool bEnable )
{ {
if( bEnable ) if( bEnable )
{ {
...@@ -2108,7 +2101,7 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped ) ...@@ -2108,7 +2101,7 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped )
{ {
WatchItem* pItem = (WatchItem*)pEntry->GetUserData(); WatchItem* pItem = (WatchItem*)pEntry->GetUserData();
String aVName( pItem->maName ); String aVName( pItem->maName );
DBG_ASSERT( aVName.Len(), "Var? - Darf nicht leer sein!" ); DBG_ASSERT( aVName.Len(), "Var? - Must not be empty!" );
String aWatchStr; String aWatchStr;
String aTypeStr; String aTypeStr;
if ( pCurMethod ) if ( pCurMethod )
...@@ -2121,7 +2114,6 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped ) ...@@ -2121,7 +2114,6 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped )
{ {
SbxDimArray* pRootArray = pItem->GetRootArray(); SbxDimArray* pRootArray = pItem->GetRootArray();
SbxDataType eType = pRootArray->GetType(); SbxDataType eType = pRootArray->GetType();
// SbxDataType eType = pItem->mpArray->GetType();
aTypeStr = implCreateTypeStringForDimArray( pItem, eType ); aTypeStr = implCreateTypeStringForDimArray( pItem, eType );
implEnableChildren( pEntry, true ); implEnableChildren( pEntry, true );
} }
...@@ -2130,7 +2122,7 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped ) ...@@ -2130,7 +2122,7 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped )
if ( pSBX && pSBX->ISA( SbxVariable ) && !pSBX->ISA( SbxMethod ) ) if ( pSBX && pSBX->ISA( SbxVariable ) && !pSBX->ISA( SbxMethod ) )
{ {
SbxVariable* pVar = (SbxVariable*)pSBX; SbxVariable* pVar = (SbxVariable*)pSBX;
// Sonderbehandlung fuer Arrays: // extra treatment of arrays
SbxDataType eType = pVar->GetType(); SbxDataType eType = pVar->GetType();
if ( eType & SbxARRAY ) if ( eType & SbxARRAY )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment