diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-03-10 16:55:21 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-03-10 20:21:13 -0500 |
commit | 12343c15568dcc2c9209d8ca41fda2263122448f (patch) | |
tree | 3212a89c6cd8ea2e0aee7103aa9669bbb8a6f307 /sc/source/ui/dbgui | |
parent | 99745dbcbb25b61437914c9782475d0b67a4b0bd (diff) | |
parent | ce6308e4fad2281241bf4ca78280eba29f744d43 (diff) |
Merge commit 'ooo/DEV300_m101' into integration/dev300_m101
Diffstat (limited to 'sc/source/ui/dbgui')
35 files changed, 1116 insertions, 861 deletions
diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx index 73826a06c9d9..c0b9305ba3ee 100644 --- a/sc/source/ui/dbgui/asciiopt.cxx +++ b/sc/source/ui/dbgui/asciiopt.cxx @@ -51,15 +51,15 @@ static const sal_Char pStrMrg[] = "MRG"; // ============================================================================ ScAsciiOptions::ScAsciiOptions() : - bFixedLen ( FALSE ), + bFixedLen ( false ), aFieldSeps ( ';' ), - bMergeFieldSeps ( FALSE ), + bMergeFieldSeps ( false ), bQuotedFieldAsText(false), bDetectSpecialNumber(false), cTextSep ( cDefaultTextSep ), eCharSet ( gsl_getSystemTextEncoding() ), eLang ( LANGUAGE_SYSTEM ), - bCharSetSystem ( FALSE ), + bCharSetSystem ( false ), nStartRow ( 1 ), nInfoCount ( 0 ), pColStart ( NULL ), @@ -84,8 +84,8 @@ ScAsciiOptions::ScAsciiOptions(const ScAsciiOptions& rOpt) : if (nInfoCount) { pColStart = new xub_StrLen[nInfoCount]; - pColFormat = new BYTE[nInfoCount]; - for (USHORT i=0; i<nInfoCount; i++) + pColFormat = new sal_uInt8[nInfoCount]; + for (sal_uInt16 i=0; i<nInfoCount; i++) { pColStart[i] = rOpt.pColStart[i]; pColFormat[i] = rOpt.pColFormat[i]; @@ -106,7 +106,7 @@ ScAsciiOptions::~ScAsciiOptions() } -void ScAsciiOptions::SetColInfo( USHORT nCount, const xub_StrLen* pStart, const BYTE* pFormat ) +void ScAsciiOptions::SetColInfo( sal_uInt16 nCount, const xub_StrLen* pStart, const sal_uInt8* pFormat ) { delete[] pColStart; delete[] pColFormat; @@ -116,8 +116,8 @@ void ScAsciiOptions::SetColInfo( USHORT nCount, const xub_StrLen* pStart, const if (nInfoCount) { pColStart = new xub_StrLen[nInfoCount]; - pColFormat = new BYTE[nInfoCount]; - for (USHORT i=0; i<nInfoCount; i++) + pColFormat = new sal_uInt8[nInfoCount]; + for (sal_uInt16 i=0; i<nInfoCount; i++) { pColStart[i] = pStart[i]; pColFormat[i] = pFormat[i]; @@ -169,7 +169,7 @@ ScAsciiOptions& ScAsciiOptions::operator=( const ScAsciiOptions& rCpy ) } -BOOL ScAsciiOptions::operator==( const ScAsciiOptions& rCmp ) const +sal_Bool ScAsciiOptions::operator==( const ScAsciiOptions& rCmp ) const { if ( bFixedLen == rCmp.bFixedLen && aFieldSeps == rCmp.aFieldSeps && @@ -183,14 +183,14 @@ BOOL ScAsciiOptions::operator==( const ScAsciiOptions& rCmp ) const { DBG_ASSERT( !nInfoCount || (pColStart && pColFormat && rCmp.pColStart && rCmp.pColFormat), "0-Zeiger in ScAsciiOptions" ); - for (USHORT i=0; i<nInfoCount; i++) + for (sal_uInt16 i=0; i<nInfoCount; i++) if ( pColStart[i] != rCmp.pColStart[i] || pColFormat[i] != rCmp.pColFormat[i] ) - return FALSE; + return false; - return TRUE; + return sal_True; } - return FALSE; + return false; } // @@ -212,18 +212,18 @@ void ScAsciiOptions::ReadFromString( const String& rString ) if ( nCount >= 1 ) { - bFixedLen = bMergeFieldSeps = FALSE; + bFixedLen = bMergeFieldSeps = false; aFieldSeps.Erase(); aToken = rString.GetToken(0,','); if ( aToken.EqualsAscii(pStrFix) ) - bFixedLen = TRUE; + bFixedLen = sal_True; nSub = aToken.GetTokenCount('/'); for ( i=0; i<nSub; i++ ) { String aCode = aToken.GetToken( i, '/' ); if ( aCode.EqualsAscii(pStrMrg) ) - bMergeFieldSeps = TRUE; + bMergeFieldSeps = sal_True; else { sal_Int32 nVal = aCode.ToInt32(); @@ -279,11 +279,11 @@ void ScAsciiOptions::ReadFromString( const String& rString ) if (nInfoCount) { pColStart = new xub_StrLen[nInfoCount]; - pColFormat = new BYTE[nInfoCount]; - for (USHORT nInfo=0; nInfo<nInfoCount; nInfo++) + pColFormat = new sal_uInt8[nInfoCount]; + for (sal_uInt16 nInfo=0; nInfo<nInfoCount; nInfo++) { pColStart[nInfo] = (xub_StrLen) aToken.GetToken( 2*nInfo, '/' ).ToInt32(); - pColFormat[nInfo] = (BYTE) aToken.GetToken( 2*nInfo+1, '/' ).ToInt32(); + pColFormat[nInfo] = (sal_uInt8) aToken.GetToken( 2*nInfo+1, '/' ).ToInt32(); } } else @@ -313,6 +313,10 @@ void ScAsciiOptions::ReadFromString( const String& rString ) aToken = rString.GetToken(7, ','); bDetectSpecialNumber = aToken.EqualsAscii("true") ? true : false; } + else + bDetectSpecialNumber = sal_True; // default of versions that didn't add the parameter + + // 9th token is used for "Save as shown" in export options } @@ -375,7 +379,7 @@ String ScAsciiOptions::WriteToString() const // DBG_ASSERT( !nInfoCount || (pColStart && pColFormat), "0-Zeiger in ScAsciiOptions" ); - for (USHORT nInfo=0; nInfo<nInfoCount; nInfo++) + for (sal_uInt16 nInfo=0; nInfo<nInfoCount; nInfo++) { if (nInfo) aOutStr += '/'; @@ -400,6 +404,8 @@ String ScAsciiOptions::WriteToString() const // Detect special nubmers. aOutStr += String::CreateFromAscii(bDetectSpecialNumber ? "true" : "false"); + // 9th token is used for "Save as shown" in export options + return aOutStr; } diff --git a/sc/source/ui/dbgui/asciiopt.src b/sc/source/ui/dbgui/asciiopt.src index 9396b862d2f3..94008212c263 100644 --- a/sc/source/ui/dbgui/asciiopt.src +++ b/sc/source/ui/dbgui/asciiopt.src @@ -29,6 +29,7 @@ ModalDialog RID_SCDLG_ASCII { + HelpID = "sc:ModalDialog:RID_SCDLG_ASCII"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 320 , 305 ) ; @@ -71,6 +72,7 @@ ModalDialog RID_SCDLG_ASCII ListBox LB_CHARSET { + HelpID = "sc:ListBox:RID_SCDLG_ASCII:LB_CHARSET"; Pos = MAP_APPFONT ( 76 , 14 ) ; Size = MAP_APPFONT ( 130 , 61 ) ; TabStop = TRUE ; @@ -87,6 +89,7 @@ ModalDialog RID_SCDLG_ASCII ListBox LB_CUSTOMLANG { + HelpID = "sc:ListBox:RID_SCDLG_ASCII:LB_CUSTOMLANG"; Pos = MAP_APPFONT ( 76 , 30 ) ; Size = MAP_APPFONT ( 130 , 61 ) ; TabStop = TRUE ; @@ -103,6 +106,7 @@ ModalDialog RID_SCDLG_ASCII NumericField NF_AT_ROW { + HelpID = "sc:NumericField:RID_SCDLG_ASCII:NF_AT_ROW"; Border = TRUE ; SVLook = TRUE ; Pos = MAP_APPFONT ( 76 , 46 ) ; @@ -121,6 +125,7 @@ ModalDialog RID_SCDLG_ASCII }; RadioButton RB_FIXED { + HelpID = "sc:RadioButton:RID_SCDLG_ASCII:RB_FIXED"; Pos = MAP_APPFONT ( 12 , 75 ) ; Size = MAP_APPFONT ( 243 , 10 ) ; Text [ en-US ] = "~Fixed width" ; @@ -128,6 +133,7 @@ ModalDialog RID_SCDLG_ASCII }; RadioButton RB_SEPARATED { + HelpID = "sc:RadioButton:RID_SCDLG_ASCII:RB_SEPARATED"; Pos = MAP_APPFONT ( 12 , 89 ) ; Size = MAP_APPFONT ( 243 , 10 ) ; Text [ en-US ] = "~Separated by" ; @@ -137,6 +143,7 @@ ModalDialog RID_SCDLG_ASCII CheckBox CKB_TAB { + HelpID = "sc:CheckBox:RID_SCDLG_ASCII:CKB_TAB"; Pos = MAP_APPFONT ( 20 , 102 ) ; Size = MAP_APPFONT ( 68 , 10 ) ; TabStop = TRUE ; @@ -144,6 +151,7 @@ ModalDialog RID_SCDLG_ASCII }; CheckBox CKB_COMMA { + HelpID = "sc:CheckBox:RID_SCDLG_ASCII:CKB_COMMA"; Pos = MAP_APPFONT ( 92 , 102 ) ; Size = MAP_APPFONT ( 68 , 10 ) ; TabStop = TRUE ; @@ -151,6 +159,7 @@ ModalDialog RID_SCDLG_ASCII }; CheckBox CKB_OTHER { + HelpID = "sc:CheckBox:RID_SCDLG_ASCII:CKB_OTHER"; Pos = MAP_APPFONT ( 164 , 102 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; TabStop = TRUE ; @@ -158,6 +167,7 @@ ModalDialog RID_SCDLG_ASCII }; Edit ED_OTHER { + HelpID = "sc:Edit:RID_SCDLG_ASCII:ED_OTHER"; Border = TRUE ; Pos = MAP_APPFONT ( 218 , 100 ) ; Size = MAP_APPFONT ( 37 , 12 ) ; @@ -167,6 +177,7 @@ ModalDialog RID_SCDLG_ASCII CheckBox CKB_SEMICOLON { + HelpID = "sc:CheckBox:RID_SCDLG_ASCII:CKB_SEMICOLON"; Pos = MAP_APPFONT ( 20 , 115 ) ; Size = MAP_APPFONT ( 68 , 10 ) ; TabStop = TRUE ; @@ -174,6 +185,7 @@ ModalDialog RID_SCDLG_ASCII }; CheckBox CKB_SPACE { + HelpID = "sc:CheckBox:RID_SCDLG_ASCII:CKB_SPACE"; Pos = MAP_APPFONT ( 92 , 115 ) ; Size = MAP_APPFONT ( 68 , 10 ) ; TabStop = TRUE ; @@ -182,6 +194,7 @@ ModalDialog RID_SCDLG_ASCII CheckBox CB_ASONCE { + HelpID = "sc:CheckBox:RID_SCDLG_ASCII:CB_ASONCE"; Pos = MAP_APPFONT ( 20 , 130 ) ; Size = MAP_APPFONT ( 130 , 10 ) ; TabStop = TRUE ; @@ -190,6 +203,7 @@ ModalDialog RID_SCDLG_ASCII ComboBox CB_TEXTSEP { + HelpID = "sc:ComboBox:RID_SCDLG_ASCII:CB_TEXTSEP"; Pos = MAP_APPFONT ( 218 , 128 ) ; Size = MAP_APPFONT ( 37 , 94 ) ; TabStop = TRUE ; @@ -211,6 +225,7 @@ ModalDialog RID_SCDLG_ASCII CheckBox CB_QUOTED_AS_TEXT { + HelpID = "sc:CheckBox:RID_SCDLG_ASCII:CB_QUOTED_AS_TEXT"; Pos = MAP_APPFONT ( 12 , 158 ) ; Size = MAP_APPFONT ( 130 , 10 ) ; TabStop = TRUE ; @@ -219,6 +234,7 @@ ModalDialog RID_SCDLG_ASCII CheckBox CB_DETECT_SPECIAL_NUMBER { + HelpID = "sc:CheckBox:RID_SCDLG_ASCII:CB_DETECT_SPECIAL_NUMBER"; Pos = MAP_APPFONT ( 12 , 171 ) ; Size = MAP_APPFONT ( 130 , 10 ) ; TabStop = TRUE ; @@ -239,6 +255,7 @@ ModalDialog RID_SCDLG_ASCII }; ListBox LB_TYPE1 { + HelpID = "sc:ListBox:RID_SCDLG_ASCII:LB_TYPE1"; Pos = MAP_APPFONT ( 76 , 198 ) ; Size = MAP_APPFONT ( 60 , 68 ) ; TabStop = TRUE ; diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx index b6d7f2430091..3ac55d55cc12 100644 --- a/sc/source/ui/dbgui/consdlg.cxx +++ b/sc/source/ui/dbgui/consdlg.cxx @@ -65,7 +65,7 @@ public: ScAreaData() {} ~ScAreaData() {} - void Set( const String& rName, const String& rArea, BOOL bDb ) + void Set( const String& rName, const String& rArea, sal_Bool bDb ) { aStrName = rName; aStrArea = rArea; @@ -74,7 +74,7 @@ public: String aStrName; String aStrArea; - BOOL bIsDbArea; + sal_Bool bIsDbArea; }; @@ -156,7 +156,7 @@ void ScConsolidateDlg::Init() DBG_ASSERT( pViewData && pDoc && pRangeUtil, "Error in Ctor" ); String aStr; - USHORT i=0; + sal_uInt16 i=0; aEdDataArea .SetGetFocusHdl( LINK( this, ScConsolidateDlg, GetFocusHdl ) ); aEdDestArea .SetGetFocusHdl( LINK( this, ScConsolidateDlg, GetFocusHdl ) ); @@ -222,8 +222,8 @@ void ScConsolidateDlg::Init() ScRangeName* pRangeNames = pDoc->GetRangeName(); ScDBCollection* pDbNames = pDoc->GetDBCollection(); - const USHORT nRangeCount = pRangeNames ? pRangeNames->size() : 0; - const USHORT nDbCount = pDbNames ? pDbNames ->GetCount() : 0; + const sal_uInt16 nRangeCount = pRangeNames ? pRangeNames->size() : 0; + const sal_uInt16 nDbCount = pDbNames ? pDbNames ->GetCount() : 0; nAreaDataCount = nRangeCount+nDbCount; pAreaData = NULL; @@ -234,7 +234,7 @@ void ScConsolidateDlg::Init() String aStrName; String aStrArea; - USHORT nAt = 0; + sal_uInt16 nAt = 0; ScRange aRange; ScAreaNameIterator aIter( pDoc ); while ( aIter.Next( aStrName, aRange ) ) @@ -269,7 +269,7 @@ void ScConsolidateDlg::FillAreaLists() { String aString; - for ( USHORT i=0; + for ( sal_uInt16 i=0; (i<nAreaDataCount) && (pAreaData[i].aStrName.Len()>0); i++ ) { @@ -295,7 +295,7 @@ void ScConsolidateDlg::SetReference( const ScRange& rRef, ScDocument* pDocP ) RefInputStart( pRefInputEdit ); String aStr; - USHORT nFmt = SCR_ABS_3D; //!!! nCurTab fehlt noch + sal_uInt16 nFmt = SCR_ABS_3D; //!!! nCurTab fehlt noch const formula::FormulaGrammar::AddressConvention eConv = pDocP->GetAddressConvention(); if ( rRef.aStart.Tab() != rRef.aEnd.Tab() ) @@ -315,7 +315,7 @@ void ScConsolidateDlg::SetReference( const ScRange& rRef, ScDocument* pDocP ) //---------------------------------------------------------------------------- -BOOL ScConsolidateDlg::Close() +sal_Bool ScConsolidateDlg::Close() { return DoClose( ScConsolidateDlgWrapper::GetChildWindowId() ); } @@ -327,7 +327,7 @@ void ScConsolidateDlg::SetActive() { if ( bDlgLostFocus ) { - bDlgLostFocus = FALSE; + bDlgLostFocus = false; if ( pRefInputEdit ) { @@ -346,20 +346,20 @@ void ScConsolidateDlg::SetActive() void ScConsolidateDlg::Deactivate() { - bDlgLostFocus = TRUE; + bDlgLostFocus = sal_True; } //---------------------------------------------------------------------------- -BOOL ScConsolidateDlg::VerifyEdit( formula::RefEdit* pEd ) +sal_Bool ScConsolidateDlg::VerifyEdit( formula::RefEdit* pEd ) { if ( !pRangeUtil || !pDoc || !pViewData || ((pEd != &aEdDataArea) && (pEd != &aEdDestArea)) ) - return FALSE; + return false; SCTAB nTab = pViewData->GetTabNo(); - BOOL bEditOk = FALSE; + sal_Bool bEditOk = false; String theCompleteStr; const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention(); @@ -411,7 +411,7 @@ IMPL_LINK( ScConsolidateDlg, GetFocusHdl, Control*, pCtr ) IMPL_LINK( ScConsolidateDlg, OkHdl, void*, EMPTYARG ) { - USHORT nDataAreaCount = aLbConsAreas.GetEntryCount(); + sal_uInt16 nDataAreaCount = aLbConsAreas.GetEntryCount(); if ( nDataAreaCount > 0 ) { @@ -425,7 +425,7 @@ IMPL_LINK( ScConsolidateDlg, OkHdl, void*, EMPTYARG ) ScConsolidateParam theOutParam( theConsData ); ScArea** ppDataAreas = new ScArea*[nDataAreaCount]; ScArea* pArea; - USHORT i=0; + sal_uInt16 i=0; for ( i=0; i<nDataAreaCount; i++ ) { @@ -450,7 +450,7 @@ IMPL_LINK( ScConsolidateDlg, OkHdl, void*, EMPTYARG ) ScConsolidateItem aOutItem( nWhichCons, &theOutParam ); - SetDispatcherLock( FALSE ); + SetDispatcherLock( false ); SwitchToDocument(); GetBindings().GetDispatcher()->Execute( SID_CONSOLIDATE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD, @@ -481,16 +481,16 @@ IMPL_LINK( ScConsolidateDlg, ClickHdl, PushButton*, pBtn ) { String aNewEntry( aEdDataArea.GetText() ); ScArea** ppAreas = NULL; - USHORT nAreaCount = 0; + sal_uInt16 nAreaCount = 0; const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention(); - if ( pRangeUtil->IsAbsTabArea( aNewEntry, pDoc, &ppAreas, &nAreaCount, TRUE, eConv ) ) + if ( pRangeUtil->IsAbsTabArea( aNewEntry, pDoc, &ppAreas, &nAreaCount, sal_True, eConv ) ) { // IsAbsTabArea() legt ein Array von ScArea-Zeigern an, // welche ebenfalls dynamisch erzeugt wurden. // Diese Objekte muessen hier abgeraeumt werden. - for ( USHORT i=0; i<nAreaCount; i++ ) + for ( sal_uInt16 i=0; i<nAreaCount; i++ ) { String aNewArea; @@ -551,7 +551,7 @@ IMPL_LINK( ScConsolidateDlg, SelectHdl, ListBox*, pLb ) else if ( (pLb == &aLbDataArea) || (pLb == &aLbDestArea) ) { Edit* pEd = (pLb == &aLbDataArea) ? &aEdDataArea : &aEdDestArea; - USHORT nSelPos = pLb->GetSelectEntryPos(); + sal_uInt16 nSelPos = pLb->GetSelectEntryPos(); if ( pRangeUtil && (nSelPos > 0) @@ -610,7 +610,7 @@ IMPL_LINK( ScConsolidateDlg, ModifyHdl, formula::RefEdit*, pEd ) // auch noch in tpsubt bzw. ueberall, wo StarCalc-Funktionen // auswaehlbar sind. -ScSubTotalFunc ScConsolidateDlg::LbPosToFunc( USHORT nPos ) +ScSubTotalFunc ScConsolidateDlg::LbPosToFunc( sal_uInt16 nPos ) { switch ( nPos ) { @@ -633,7 +633,7 @@ ScSubTotalFunc ScConsolidateDlg::LbPosToFunc( USHORT nPos ) //---------------------------------------------------------------------------- -USHORT ScConsolidateDlg::FuncToLbPos( ScSubTotalFunc eFunc ) +sal_uInt16 ScConsolidateDlg::FuncToLbPos( ScSubTotalFunc eFunc ) { switch ( eFunc ) { diff --git a/sc/source/ui/dbgui/consdlg.src b/sc/source/ui/dbgui/consdlg.src index 9716b190c886..394dd80ac9b4 100644 --- a/sc/source/ui/dbgui/consdlg.src +++ b/sc/source/ui/dbgui/consdlg.src @@ -28,7 +28,7 @@ ModelessDialog RID_SCDLG_CONSOLIDATE { OutputSize = TRUE ; - HelpId = SID_OPENDLG_CONSOLIDATE ; + HelpId = CMD_SID_OPENDLG_CONSOLIDATE ; Hide = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 280 , 154 ) ; @@ -37,6 +37,7 @@ ModelessDialog RID_SCDLG_CONSOLIDATE Closeable = FALSE ; ListBox LB_FUNC { + HelpID = "sc:ListBox:RID_SCDLG_CONSOLIDATE:LB_FUNC"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 17 ) ; Size = MAP_APPFONT ( 212 , 90 ) ; @@ -59,6 +60,7 @@ ModelessDialog RID_SCDLG_CONSOLIDATE }; Edit ED_DATA_AREA { + HelpID = "sc:Edit:RID_SCDLG_CONSOLIDATE:ED_DATA_AREA"; Border = TRUE ; Pos = MAP_APPFONT ( 100 , 106 ) ; Size = MAP_APPFONT ( 104 , 12 ) ; @@ -66,6 +68,7 @@ ModelessDialog RID_SCDLG_CONSOLIDATE }; Edit ED_DEST_AREA { + HelpID = "sc:Edit:RID_SCDLG_CONSOLIDATE:ED_DEST_AREA"; Border = TRUE ; Pos = MAP_APPFONT ( 100 , 135 ) ; Size = MAP_APPFONT ( 104 , 12 ) ; @@ -73,6 +76,7 @@ ModelessDialog RID_SCDLG_CONSOLIDATE }; ImageButton RB_DATA_AREA { + HelpID = "sc:ImageButton:RID_SCDLG_CONSOLIDATE:RB_DATA_AREA"; Pos = MAP_APPFONT ( 206 , 105 ) ; Size = MAP_APPFONT ( 13 , 15 ) ; TabStop = TRUE ; @@ -80,6 +84,7 @@ ModelessDialog RID_SCDLG_CONSOLIDATE }; ImageButton RB_DEST_AREA { + HelpID = "sc:ImageButton:RID_SCDLG_CONSOLIDATE:RB_DEST_AREA"; Pos = MAP_APPFONT ( 206 , 134 ) ; Size = MAP_APPFONT ( 13 , 15 ) ; TabStop = TRUE ; @@ -87,6 +92,7 @@ ModelessDialog RID_SCDLG_CONSOLIDATE }; ListBox LB_DATA_AREA { + HelpID = "sc:ListBox:RID_SCDLG_CONSOLIDATE:LB_DATA_AREA"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 106 ) ; Size = MAP_APPFONT ( 90 , 90 ) ; @@ -95,6 +101,7 @@ ModelessDialog RID_SCDLG_CONSOLIDATE }; ListBox LB_DEST_AREA { + HelpID = "sc:ListBox:RID_SCDLG_CONSOLIDATE:LB_DEST_AREA"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 135 ) ; Size = MAP_APPFONT ( 90 , 90 ) ; @@ -103,6 +110,7 @@ ModelessDialog RID_SCDLG_CONSOLIDATE }; MultiListBox LB_CONSAREAS { + HelpID = "sc:MultiListBox:RID_SCDLG_CONSOLIDATE:LB_CONSAREAS"; SimpleMode = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 46 ) ; @@ -135,6 +143,7 @@ ModelessDialog RID_SCDLG_CONSOLIDATE }; CheckBox BTN_BYROW { + HelpID = "sc:CheckBox:RID_SCDLG_CONSOLIDATE:BTN_BYROW"; Pos = MAP_APPFONT ( 12 , 165 ) ; Size = MAP_APPFONT ( 94 , 10 ) ; Text [ en-US ] = "~Row labels" ; @@ -142,6 +151,7 @@ ModelessDialog RID_SCDLG_CONSOLIDATE }; CheckBox BTN_BYCOL { + HelpID = "sc:CheckBox:RID_SCDLG_CONSOLIDATE:BTN_BYCOL"; Pos = MAP_APPFONT ( 12 , 179 ) ; Size = MAP_APPFONT ( 94 , 10 ) ; TabStop = TRUE ; @@ -167,6 +177,7 @@ ModelessDialog RID_SCDLG_CONSOLIDATE }; CheckBox BTN_REFS { + HelpID = "sc:CheckBox:RID_SCDLG_CONSOLIDATE:BTN_REFS"; Pos = MAP_APPFONT ( 121 , 165 ) ; Size = MAP_APPFONT ( 94 , 10 ) ; Text [ en-US ] = "~Link to source data" ; @@ -193,6 +204,7 @@ ModelessDialog RID_SCDLG_CONSOLIDATE }; MoreButton BTN_MORE { + HelpID = "sc:MoreButton:RID_SCDLG_CONSOLIDATE:BTN_MORE"; Pos = MAP_APPFONT ( 224 , 134 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -201,6 +213,7 @@ ModelessDialog RID_SCDLG_CONSOLIDATE }; PushButton BTN_REMOVE { + HelpID = "sc:PushButton:RID_SCDLG_CONSOLIDATE:BTN_REMOVE"; Pos = MAP_APPFONT ( 224 , 114 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Delete" ; @@ -208,6 +221,7 @@ ModelessDialog RID_SCDLG_CONSOLIDATE }; PushButton BTN_ADD { + HelpID = "sc:PushButton:RID_SCDLG_CONSOLIDATE:BTN_ADD"; Pos = MAP_APPFONT ( 224 , 96 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Add" ; diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx index f399c6b2488a..15a0eb4e10cd 100644 --- a/sc/source/ui/dbgui/csvgrid.cxx +++ b/sc/source/ui/dbgui/csvgrid.cxx @@ -82,7 +82,7 @@ struct Func_Select ScCsvGrid::ScCsvGrid( ScCsvControl& rParent ) : ScCsvControl( rParent ), mpColorConfig( 0 ), - mpEditEngine( new ScEditEngineDefaulter( EditEngine::CreatePool(), TRUE ) ), + mpEditEngine( new ScEditEngineDefaulter( EditEngine::CreatePool(), true ) ), maHeaderFont( GetFont() ), maColStates( 1 ), maTypeNames( 1 ), @@ -252,7 +252,7 @@ void ScCsvGrid::InitFonts() aDefSet.Put( aComplexItem ); // set Asian/Complex font size to height of character in Latin font - ULONG nFontHt = static_cast< ULONG >( maMonoFont.GetSize().Height() ); + sal_uLong nFontHt = static_cast< sal_uLong >( maMonoFont.GetSize().Height() ); aDefSet.Put( SvxFontHeightItem( nFontHt, 100, EE_CHAR_FONTHEIGHT_CJK ) ); aDefSet.Put( SvxFontHeightItem( nFontHt, 100, EE_CHAR_FONTHEIGHT_CTL ) ); @@ -903,8 +903,8 @@ void ScCsvGrid::KeyInput( const KeyEvent& rKEvt ) { const KeyCode& rKCode = rKEvt.GetKeyCode(); sal_uInt16 nCode = rKCode.GetCode(); - bool bShift = rKCode.IsShift() == TRUE; - bool bMod1 = rKCode.IsMod1() == TRUE; + bool bShift = rKCode.IsShift() == sal_True; + bool bMod1 = rKCode.IsMod1() == sal_True; if( !rKCode.IsMod2() ) { diff --git a/sc/source/ui/dbgui/csvruler.cxx b/sc/source/ui/dbgui/csvruler.cxx index 6f6a499b81cd..dbc21d51afb2 100644 --- a/sc/source/ui/dbgui/csvruler.cxx +++ b/sc/source/ui/dbgui/csvruler.cxx @@ -129,7 +129,7 @@ ScCsvRuler::~ScCsvRuler() // common ruler handling ------------------------------------------------------ void ScCsvRuler::SetPosSizePixel( - long nX, long nY, long nWidth, long nHeight, USHORT nFlags ) + long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) { if( nFlags & WINDOW_POSSIZE_HEIGHT ) nHeight = GetTextHeight() + mnSplitSize + 2; diff --git a/sc/source/ui/dbgui/dapidata.cxx b/sc/source/ui/dbgui/dapidata.cxx index 2b7b56b116a9..63d11e1141ae 100644 --- a/sc/source/ui/dbgui/dapidata.cxx +++ b/sc/source/ui/dbgui/dapidata.cxx @@ -125,7 +125,7 @@ ScDataPilotDatabaseDlg::~ScDataPilotDatabaseDlg() void ScDataPilotDatabaseDlg::GetValues( ScImportSourceDesc& rDesc ) { - USHORT nSelect = aLbType.GetSelectEntryPos(); + sal_uInt16 nSelect = aLbType.GetSelectEntryPos(); rDesc.aDBName = aLbDatabase.GetSelectEntry(); rDesc.aObject = aCbObject.GetText(); @@ -156,7 +156,7 @@ void ScDataPilotDatabaseDlg::FillObjects() if (!aDatabaseName.Len()) return; - USHORT nSelect = aLbType.GetSelectEntryPos(); + sal_uInt16 nSelect = aLbType.GetSelectEntryPos(); if ( nSelect > DP_TYPELIST_QUERY ) return; // only tables and queries diff --git a/sc/source/ui/dbgui/dapitype.cxx b/sc/source/ui/dbgui/dapitype.cxx index 507df18c5829..086d4778fba8 100644 --- a/sc/source/ui/dbgui/dapitype.cxx +++ b/sc/source/ui/dbgui/dapitype.cxx @@ -45,7 +45,7 @@ using ::rtl::OUString; //------------------------------------------------------------------------- -ScDataPilotSourceTypeDlg::ScDataPilotSourceTypeDlg( Window* pParent, BOOL bEnableExternal ) : +ScDataPilotSourceTypeDlg::ScDataPilotSourceTypeDlg( Window* pParent, sal_Bool bEnableExternal ) : ModalDialog ( pParent, ScResId( RID_SCDLG_DAPITYPE ) ), // aFlFrame ( this, ScResId( FL_FRAME ) ), @@ -96,7 +96,7 @@ bool ScDataPilotSourceTypeDlg::IsNamedRange() const OUString ScDataPilotSourceTypeDlg::GetSelectedNamedRange() const { - USHORT nPos = aLbNamedRange.GetSelectEntryPos(); + sal_uInt16 nPos = aLbNamedRange.GetSelectEntryPos(); return aLbNamedRange.GetEntry(nPos); } diff --git a/sc/source/ui/dbgui/dapitype.src b/sc/source/ui/dbgui/dapitype.src index fa49dfbb6bcf..283106c15e84 100644 --- a/sc/source/ui/dbgui/dapitype.src +++ b/sc/source/ui/dbgui/dapitype.src @@ -140,6 +140,7 @@ ModalDialog RID_SCDLG_DAPISERVICE }; ListBox LB_SERVICE { + HelpID = "sc:ListBox:RID_SCDLG_DAPISERVICE:LB_SERVICE"; Border = TRUE ; Pos = MAP_APPFONT ( 56 , 12 ) ; Size = MAP_APPFONT ( 120 , 80 ) ; @@ -154,6 +155,7 @@ ModalDialog RID_SCDLG_DAPISERVICE }; Edit ED_SOURCE { + HelpID = "sc:Edit:RID_SCDLG_DAPISERVICE:ED_SOURCE"; Border = TRUE ; Pos = MAP_APPFONT ( 56 , 28 ) ; Size = MAP_APPFONT ( 120 , 12 ) ; @@ -167,6 +169,7 @@ ModalDialog RID_SCDLG_DAPISERVICE }; Edit ED_NAME { + HelpID = "sc:Edit:RID_SCDLG_DAPISERVICE:ED_NAME"; Border = TRUE ; Pos = MAP_APPFONT ( 56 , 44 ) ; Size = MAP_APPFONT ( 120 , 12 ) ; @@ -180,6 +183,7 @@ ModalDialog RID_SCDLG_DAPISERVICE }; Edit ED_USER { + HelpID = "sc:Edit:RID_SCDLG_DAPISERVICE:ED_USER"; Border = TRUE ; Pos = MAP_APPFONT ( 56 , 60 ) ; Size = MAP_APPFONT ( 120 , 12 ) ; @@ -193,6 +197,7 @@ ModalDialog RID_SCDLG_DAPISERVICE }; Edit ED_PASSWD { + HelpID = "sc:Edit:RID_SCDLG_DAPISERVICE:ED_PASSWD"; Border = TRUE ; Pos = MAP_APPFONT ( 56 , 76 ) ; Size = MAP_APPFONT ( 120 , 12 ) ; @@ -248,6 +253,7 @@ ModalDialog RID_SCDLG_DAPIDATA }; ListBox LB_DATABASE { + HelpID = "sc:ListBox:RID_SCDLG_DAPIDATA:LB_DATABASE"; Border = TRUE ; Pos = MAP_APPFONT ( 66 , 12 ) ; Size = MAP_APPFONT ( 110 , 80 ) ; @@ -263,6 +269,7 @@ ModalDialog RID_SCDLG_DAPIDATA }; ComboBox CB_OBJECT { + HelpID = "sc:ComboBox:RID_SCDLG_DAPIDATA:CB_OBJECT"; Border = TRUE ; Pos = MAP_APPFONT ( 66 , 28 ) ; Size = MAP_APPFONT ( 110 , 80 ) ; @@ -278,6 +285,7 @@ ModalDialog RID_SCDLG_DAPIDATA }; ListBox LB_OBJTYPE { + HelpID = "sc:ListBox:RID_SCDLG_DAPIDATA:LB_OBJTYPE"; Border = TRUE ; Pos = MAP_APPFONT ( 66 , 44 ) ; Size = MAP_APPFONT ( 110 , 80 ) ; diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx index 69672f9802d3..fcf29c814933 100644 --- a/sc/source/ui/dbgui/dbnamdlg.cxx +++ b/sc/source/ui/dbgui/dbnamdlg.cxx @@ -78,7 +78,7 @@ public: : rEdAssign(rEd), rBtnHeader(rHdr), rBtnSize(rSize), rBtnFormat(rFmt), rBtnStrip(rStrip), rCurArea(rArea), - bHeader(FALSE), bSize(FALSE), bFormat(FALSE), bDirty(FALSE) {} + bHeader(false), bSize(false), bFormat(false), bDirty(false) {} void Save(); void Restore(); @@ -91,11 +91,11 @@ private: ScRange& rCurArea; String aStr; ScRange aArea; - BOOL bHeader:1; - BOOL bSize:1; - BOOL bFormat:1; - BOOL bStrip:1; - BOOL bDirty:1; + sal_Bool bHeader:1; + sal_Bool bSize:1; + sal_Bool bFormat:1; + sal_Bool bStrip:1; + sal_Bool bDirty:1; }; @@ -110,7 +110,7 @@ void DBSaveData::Save() bSize = rBtnSize.IsChecked(); bFormat = rBtnFormat.IsChecked(); bStrip = rBtnStrip.IsChecked(); - bDirty = TRUE; + bDirty = sal_True; } @@ -126,7 +126,7 @@ void DBSaveData::Restore() rBtnSize.Check ( bSize ); rBtnFormat.Check ( bFormat ); rBtnStrip.Check ( bStrip ); - bDirty = FALSE; + bDirty = false; } } @@ -170,7 +170,7 @@ ScDbNameDlg::ScDbNameDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, // pViewData ( ptrViewData ), pDoc ( ptrViewData->GetDocument() ), - bRefInputMode ( FALSE ), + bRefInputMode ( false ), aAddrDetails ( pDoc->GetAddressConvention(), 0, 0 ), aLocalDbCol ( *(pDoc->GetDBCollection()) ) { @@ -186,6 +186,7 @@ ScDbNameDlg::ScDbNameDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, aBtnDoSize, aBtnKeepFmt, aBtnStripData, theCurArea ); Init(); FreeResource(); + aRbAssign.SetAccessibleRelationMemberOf(&aFlAssign); } @@ -209,7 +210,7 @@ ScDbNameDlg::~ScDbNameDlg() void ScDbNameDlg::Init() { - aBtnHeader.Check( TRUE ); // Default: mit Spaltenkoepfen + aBtnHeader.Check( sal_True ); // Default: mit Spaltenkoepfen aBtnMore.AddWindow( &aFlOptions ); aBtnMore.AddWindow( &aBtnHeader ); @@ -252,7 +253,7 @@ void ScDbNameDlg::Init() if ( pDBColl ) { // Feststellen, ob definierter DB-Bereich markiert wurde: - pDBData = pDBColl->GetDBAtCursor( nStartCol, nStartRow, nStartTab, TRUE ); + pDBData = pDBColl->GetDBAtCursor( nStartCol, nStartRow, nStartTab, sal_True ); if ( pDBData ) { String theDbName; @@ -287,7 +288,7 @@ void ScDbNameDlg::Init() aEdAssign.SetText( theAreaStr ); aEdName.GrabFocus(); - bSaved=TRUE; + bSaved=sal_True; pSaveObj->Save(); NameModifyHdl( 0 ); } @@ -335,7 +336,7 @@ void ScDbNameDlg::SetReference( const ScRange& rRef, ScDocument* pDocP ) aFTSource.Enable(); aFTOperations.Enable(); aBtnAdd.Enable(); - bSaved=TRUE; + bSaved=sal_True; pSaveObj->Save(); } } @@ -343,7 +344,7 @@ void ScDbNameDlg::SetReference( const ScRange& rRef, ScDocument* pDocP ) //---------------------------------------------------------------------------- -BOOL ScDbNameDlg::Close() +sal_Bool ScDbNameDlg::Close() { return DoClose( ScDbNameDlgWrapper::GetChildWindowId() ); } @@ -365,9 +366,9 @@ void ScDbNameDlg::SetActive() void ScDbNameDlg::UpdateNames() { - USHORT nNameCount = aLocalDbCol.GetCount(); + sal_uInt16 nNameCount = aLocalDbCol.GetCount(); - aEdName.SetUpdateMode( FALSE ); + aEdName.SetUpdateMode( false ); //----------------------------------------------------------- aEdName.Clear(); aEdAssign.SetText( EMPTY_STRING ); @@ -377,7 +378,7 @@ void ScDbNameDlg::UpdateNames() ScDBData* pDbData = NULL; String aString; - for ( USHORT i=0; i<nNameCount; i++ ) + for ( sal_uInt16 i=0; i<nNameCount; i++ ) { pDbData = (ScDBData*)(aLocalDbCol.At( i )); if ( pDbData ) @@ -395,7 +396,7 @@ void ScDbNameDlg::UpdateNames() aBtnRemove.Disable(); } //----------------------------------------------------------- - aEdName.SetUpdateMode( TRUE ); + aEdName.SetUpdateMode( sal_True ); aEdName.Invalidate(); } @@ -404,7 +405,7 @@ void ScDbNameDlg::UpdateNames() void ScDbNameDlg::UpdateDBData( const String& rStrName ) { String theArea; - USHORT nAt; + sal_uInt16 nAt; ScDBData* pData; aLocalDbCol.SearchName( rStrName, nAt ); @@ -445,7 +446,7 @@ void ScDbNameDlg::UpdateDBData( const String& rStrName ) //------------------------------------------------------------------------ -BOOL ScDbNameDlg::IsRefInputMode() const +sal_Bool ScDbNameDlg::IsRefInputMode() const { return bRefInputMode; } @@ -502,7 +503,7 @@ IMPL_LINK( ScDbNameDlg, AddBtnHdl, void *, EMPTYARG ) ScAddress aEnd = theCurArea.aEnd; ScDBData* pOldEntry = NULL; - USHORT nFoundAt = 0; + sal_uInt16 nFoundAt = 0; if ( aLocalDbCol.SearchName( aNewName, nFoundAt ) ) pOldEntry = aLocalDbCol[nFoundAt]; if (pOldEntry) @@ -511,7 +512,7 @@ IMPL_LINK( ScDbNameDlg, AddBtnHdl, void *, EMPTYARG ) pOldEntry->MoveTo( aStart.Tab(), aStart.Col(), aStart.Row(), aEnd.Col(), aEnd.Row() ); - pOldEntry->SetByRow( TRUE ); + pOldEntry->SetByRow( sal_True ); pOldEntry->SetHeader( aBtnHeader.IsChecked() ); pOldEntry->SetDoSize( aBtnDoSize.IsChecked() ); pOldEntry->SetKeepFmt( aBtnKeepFmt.IsChecked() ); @@ -524,7 +525,7 @@ IMPL_LINK( ScDbNameDlg, AddBtnHdl, void *, EMPTYARG ) ScDBData* pNewEntry = new ScDBData( aNewName, aStart.Tab(), aStart.Col(), aStart.Row(), aEnd.Col(), aEnd.Row(), - TRUE, aBtnHeader.IsChecked() ); + sal_True, aBtnHeader.IsChecked() ); pNewEntry->SetDoSize( aBtnDoSize.IsChecked() ); pNewEntry->SetKeepFmt( aBtnKeepFmt.IsChecked() ); pNewEntry->SetStripData( aBtnStripData.IsChecked() ); @@ -541,13 +542,13 @@ IMPL_LINK( ScDbNameDlg, AddBtnHdl, void *, EMPTYARG ) aBtnAdd.Disable(); aBtnRemove.Disable(); aEdAssign.SetText( EMPTY_STRING ); - aBtnHeader.Check( TRUE ); // Default: mit Spaltenkoepfen - aBtnDoSize.Check( FALSE ); - aBtnKeepFmt.Check( FALSE ); - aBtnStripData.Check( FALSE ); + aBtnHeader.Check( sal_True ); // Default: mit Spaltenkoepfen + aBtnDoSize.Check( false ); + aBtnKeepFmt.Check( false ); + aBtnStripData.Check( false ); SetInfoStrings( NULL ); // leer theCurArea = ScRange(); - bSaved=TRUE; + bSaved=sal_True; pSaveObj->Save(); NameModifyHdl( 0 ); } @@ -572,7 +573,7 @@ IMPL_LINK( ScDbNameDlg, AddBtnHdl, void *, EMPTYARG ) IMPL_LINK( ScDbNameDlg, RemoveBtnHdl, void *, EMPTYARG ) { - USHORT nRemoveAt = 0; + sal_uInt16 nRemoveAt = 0; const String aStrEntry = aEdName.GetText(); if ( aLocalDbCol.SearchName( aStrEntry, nRemoveAt ) ) @@ -608,12 +609,12 @@ IMPL_LINK( ScDbNameDlg, RemoveBtnHdl, void *, EMPTYARG ) aBtnRemove.Disable(); aEdAssign.SetText( EMPTY_STRING ); theCurArea = ScRange(); - aBtnHeader.Check( TRUE ); // Default: mit Spaltenkoepfen - aBtnDoSize.Check( FALSE ); - aBtnKeepFmt.Check( FALSE ); - aBtnStripData.Check( FALSE ); + aBtnHeader.Check( sal_True ); // Default: mit Spaltenkoepfen + aBtnDoSize.Check( false ); + aBtnKeepFmt.Check( false ); + aBtnStripData.Check( false ); SetInfoStrings( NULL ); // leer - bSaved=FALSE; + bSaved=false; pSaveObj->Restore(); NameModifyHdl( 0 ); } @@ -626,7 +627,7 @@ IMPL_LINK( ScDbNameDlg, RemoveBtnHdl, void *, EMPTYARG ) IMPL_LINK( ScDbNameDlg, NameModifyHdl, void *, EMPTYARG ) { String theName = aEdName.GetText(); - BOOL bNameFound = (COMBOBOX_ENTRY_NOTFOUND + sal_Bool bNameFound = (COMBOBOX_ENTRY_NOTFOUND != aEdName.GetEntryPos( theName )); if ( theName.Len() == 0 ) @@ -644,11 +645,11 @@ IMPL_LINK( ScDbNameDlg, NameModifyHdl, void *, EMPTYARG ) aFTOperations.Disable(); aEdAssign .Disable(); aRbAssign .Disable(); - //bSaved=FALSE; + //bSaved=sal_False; //pSaveObj->Restore(); //@BugID 54702 Enablen/Disablen nur noch in Basisklasse - //SFX_APPWINDOW->Disable(FALSE); //! allgemeine Methode im ScAnyRefDlg - bRefInputMode = FALSE; + //SFX_APPWINDOW->Disable(sal_False); //! allgemeine Methode im ScAnyRefDlg + bRefInputMode = false; } else { @@ -659,7 +660,7 @@ IMPL_LINK( ScDbNameDlg, NameModifyHdl, void *, EMPTYARG ) if(!bSaved) { - bSaved=TRUE; + bSaved=sal_True; pSaveObj->Save(); } UpdateDBData( theName ); @@ -669,7 +670,7 @@ IMPL_LINK( ScDbNameDlg, NameModifyHdl, void *, EMPTYARG ) if ( aBtnAdd.GetText() != aStrAdd ) aBtnAdd.SetText( aStrAdd ); - bSaved=FALSE; + bSaved=false; pSaveObj->Restore(); if ( aEdAssign.GetText().Len() > 0 ) @@ -701,7 +702,7 @@ IMPL_LINK( ScDbNameDlg, NameModifyHdl, void *, EMPTYARG ) //@BugID 54702 Enablen/Disablen nur noch in Basisklasse //SFX_APPWINDOW->Enable(); - bRefInputMode = TRUE; + bRefInputMode = sal_True; } return 0; } diff --git a/sc/source/ui/dbgui/dpgroupdlg.cxx b/sc/source/ui/dbgui/dpgroupdlg.cxx index e665b215c0e9..82ccb987599e 100644 --- a/sc/source/ui/dbgui/dpgroupdlg.cxx +++ b/sc/source/ui/dbgui/dpgroupdlg.cxx @@ -197,7 +197,7 @@ ScDPNumGroupInfo ScDPNumGroupDlg::GetGroupInfo() const { ScDPNumGroupInfo aInfo; aInfo.Enable = sal_True; - aInfo.DateValues = sal_False; + aInfo.DateValues = false; aInfo.AutoStart = maStartHelper.IsAuto(); aInfo.AutoEnd = maEndHelper.IsAuto(); @@ -239,21 +239,21 @@ ScDPDateGroupDlg::ScDPDateGroupDlg( Window* pParent, { maLbUnits.SetHelpId( HID_SC_DPDATEGROUP_LB ); ResStringArray aArr( ScResId( STR_UNITS ) ); - for( USHORT nIdx = 0, nCount = sal::static_int_cast<USHORT>(aArr.Count()); nIdx < nCount; ++nIdx ) + for( sal_uInt16 nIdx = 0, nCount = sal::static_int_cast<sal_uInt16>(aArr.Count()); nIdx < nCount; ++nIdx ) maLbUnits.InsertEntry( aArr.GetString( nIdx ) ); FreeResource(); - maEdStart.SetShowDateCentury( TRUE ); - maEdEnd.SetShowDateCentury( TRUE ); + maEdStart.SetShowDateCentury( sal_True ); + maEdEnd.SetShowDateCentury( sal_True ); maStartHelper.SetValue( rInfo.AutoStart, rInfo.Start ); maEndHelper.SetValue( rInfo.AutoEnd, rInfo.End ); if( nDatePart == 0 ) nDatePart = com::sun::star::sheet::DataPilotFieldGroupBy::MONTHS; - for( ULONG nIdx = 0, nCount = maLbUnits.GetEntryCount(); nIdx < nCount; ++nIdx ) - maLbUnits.CheckEntryPos( static_cast< USHORT >( nIdx ), (nDatePart & spnDateParts[ nIdx ]) != 0 ); + for( sal_uLong nIdx = 0, nCount = maLbUnits.GetEntryCount(); nIdx < nCount; ++nIdx ) + maLbUnits.CheckEntryPos( static_cast< sal_uInt16 >( nIdx ), (nDatePart & spnDateParts[ nIdx ]) != 0 ); if( rInfo.DateValues ) { @@ -317,8 +317,8 @@ sal_Int32 ScDPDateGroupDlg::GetDatePart() const // return listbox contents for "units" mode sal_Int32 nDatePart = 0; - for( ULONG nIdx = 0, nCount = maLbUnits.GetEntryCount(); nIdx < nCount; ++nIdx ) - if( maLbUnits.IsChecked( static_cast< USHORT >( nIdx ) ) ) + for( sal_uLong nIdx = 0, nCount = maLbUnits.GetEntryCount(); nIdx < nCount; ++nIdx ) + if( maLbUnits.IsChecked( static_cast< sal_uInt16 >( nIdx ) ) ) nDatePart |= spnDateParts[ nIdx ]; return nDatePart; } diff --git a/sc/source/ui/dbgui/dpgroupdlg.src b/sc/source/ui/dbgui/dpgroupdlg.src index 6e6ba170f1b1..4e73cfc185da 100644 --- a/sc/source/ui/dbgui/dpgroupdlg.src +++ b/sc/source/ui/dbgui/dpgroupdlg.src @@ -46,6 +46,7 @@ ModalDialog RID_SCDLG_DPNUMGROUP }; RadioButton RB_AUTOSTART { + HelpID = "sc:RadioButton:RID_SCDLG_DPNUMGROUP:RB_AUTOSTART"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 80 , 10 ) ; TabStop = TRUE ; @@ -53,6 +54,7 @@ ModalDialog RID_SCDLG_DPNUMGROUP }; RadioButton RB_MANSTART { + HelpID = "sc:RadioButton:RID_SCDLG_DPNUMGROUP:RB_MANSTART"; Pos = MAP_APPFONT ( 12 , 28 ) ; Size = MAP_APPFONT ( 80 , 10 ) ; TabStop = TRUE ; @@ -60,6 +62,7 @@ ModalDialog RID_SCDLG_DPNUMGROUP }; Edit ED_START { + HelpID = "sc:Edit:RID_SCDLG_DPNUMGROUP:ED_START"; Pos = MAP_APPFONT ( 94 , 26 ) ; Size = MAP_APPFONT ( 58 , 12 ) ; TabStop = TRUE ; @@ -73,6 +76,7 @@ ModalDialog RID_SCDLG_DPNUMGROUP }; RadioButton RB_AUTOEND { + HelpID = "sc:RadioButton:RID_SCDLG_DPNUMGROUP:RB_AUTOEND"; Pos = MAP_APPFONT ( 12 , 53 ) ; Size = MAP_APPFONT ( 80 , 10 ) ; TabStop = TRUE ; @@ -80,6 +84,7 @@ ModalDialog RID_SCDLG_DPNUMGROUP }; RadioButton RB_MANEND { + HelpID = "sc:RadioButton:RID_SCDLG_DPNUMGROUP:RB_MANEND"; Pos = MAP_APPFONT ( 12 , 67 ) ; Size = MAP_APPFONT ( 80 , 10 ) ; TabStop = TRUE ; @@ -87,6 +92,7 @@ ModalDialog RID_SCDLG_DPNUMGROUP }; Edit ED_END { + HelpID = "sc:Edit:RID_SCDLG_DPNUMGROUP:ED_END"; Pos = MAP_APPFONT ( 94 , 65 ) ; Size = MAP_APPFONT ( 58 , 12 ) ; TabStop = TRUE ; @@ -100,6 +106,7 @@ ModalDialog RID_SCDLG_DPNUMGROUP }; Edit ED_BY { + HelpID = "sc:Edit:RID_SCDLG_DPNUMGROUP:ED_BY"; Pos = MAP_APPFONT ( 94 , 92 ) ; Size = MAP_APPFONT ( 58 , 12 ) ; TabStop = TRUE ; @@ -146,6 +153,7 @@ ModalDialog RID_SCDLG_DPDATEGROUP }; RadioButton RB_AUTOSTART { + HelpID = "sc:RadioButton:RID_SCDLG_DPDATEGROUP:RB_AUTOSTART"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 80 , 10 ) ; TabStop = TRUE ; @@ -153,6 +161,7 @@ ModalDialog RID_SCDLG_DPDATEGROUP }; RadioButton RB_MANSTART { + HelpID = "sc:RadioButton:RID_SCDLG_DPDATEGROUP:RB_MANSTART"; Pos = MAP_APPFONT ( 12 , 28 ) ; Size = MAP_APPFONT ( 80 , 10 ) ; TabStop = TRUE ; @@ -160,6 +169,7 @@ ModalDialog RID_SCDLG_DPDATEGROUP }; DateField ED_START { + HelpID = "sc:DateField:RID_SCDLG_DPDATEGROUP:ED_START"; Pos = MAP_APPFONT ( 94 , 26 ) ; Size = MAP_APPFONT ( 58 , 12 ) ; TabStop = TRUE ; @@ -173,6 +183,7 @@ ModalDialog RID_SCDLG_DPDATEGROUP }; RadioButton RB_AUTOEND { + HelpID = "sc:RadioButton:RID_SCDLG_DPDATEGROUP:RB_AUTOEND"; Pos = MAP_APPFONT ( 12 , 53 ) ; Size = MAP_APPFONT ( 80 , 10 ) ; TabStop = TRUE ; @@ -180,6 +191,7 @@ ModalDialog RID_SCDLG_DPDATEGROUP }; RadioButton RB_MANEND { + HelpID = "sc:RadioButton:RID_SCDLG_DPDATEGROUP:RB_MANEND"; Pos = MAP_APPFONT ( 12 , 67 ) ; Size = MAP_APPFONT ( 80 , 10 ) ; TabStop = TRUE ; @@ -187,6 +199,7 @@ ModalDialog RID_SCDLG_DPDATEGROUP }; DateField ED_END { + HelpID = "sc:DateField:RID_SCDLG_DPDATEGROUP:ED_END"; Pos = MAP_APPFONT ( 94 , 65 ) ; Size = MAP_APPFONT ( 58 , 12 ) ; TabStop = TRUE ; @@ -200,6 +213,7 @@ ModalDialog RID_SCDLG_DPDATEGROUP }; RadioButton RB_NUMDAYS { + HelpID = "sc:RadioButton:RID_SCDLG_DPDATEGROUP:RB_NUMDAYS"; Pos = MAP_APPFONT ( 12 , 94 ) ; Size = MAP_APPFONT ( 80 , 10 ) ; TabStop = TRUE ; @@ -207,6 +221,7 @@ ModalDialog RID_SCDLG_DPDATEGROUP }; RadioButton RB_UNITS { + HelpID = "sc:RadioButton:RID_SCDLG_DPDATEGROUP:RB_UNITS"; Pos = MAP_APPFONT ( 12 , 110 ) ; Size = MAP_APPFONT ( 80 , 10 ) ; TabStop = TRUE ; @@ -214,6 +229,7 @@ ModalDialog RID_SCDLG_DPDATEGROUP }; NumericField ED_NUMDAYS { + HelpID = "sc:NumericField:RID_SCDLG_DPDATEGROUP:ED_NUMDAYS"; Pos = MAP_APPFONT ( 94, 92 ) ; Size = MAP_APPFONT ( 35, 12 ) ; TabStop = TRUE ; diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx index 874308467850..7bd85a348dc9 100644 --- a/sc/source/ui/dbgui/fieldwnd.cxx +++ b/sc/source/ui/dbgui/fieldwnd.cxx @@ -29,14 +29,14 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" -#include <vcl/virdev.hxx> +#include "fieldwnd.hxx" + +#include <tools/debug.hxx> #include <vcl/decoview.hxx> -#include <vcl/svapp.hxx> -#include <vcl/mnemonic.hxx> #include <vcl/help.hxx> -#include <tools/debug.hxx> +#include <vcl/svapp.hxx> +#include <vcl/virdev.hxx> -#include "fieldwnd.hxx" #include "pvlaydlg.hxx" #include "dpuiglobal.hxx" #include "AccessibleDataPilotControl.hxx" @@ -231,6 +231,7 @@ void ScDPFieldControlBase::SetFieldText( const String& rText, size_t nIndex ) pAccessible = NULL; } } + return PIVOTFIELD_INVALID; } const String& ScDPFieldControlBase::GetFieldText( size_t nIndex ) const @@ -304,10 +305,9 @@ void ScDPFieldControlBase::MouseButtonDown( const MouseEvent& rMEvt ) { if( rMEvt.IsLeft() ) { - size_t nIndex = 0; - if( GetFieldIndex( rMEvt.GetPosPixel(), nIndex ) && IsExistingIndex( nIndex ) ) - { - GrabFocusWithSel( nIndex ); + --mnAutoScrollDelay; + return; + } if( rMEvt.GetClicks() == 1 ) { @@ -323,7 +323,9 @@ void ScDPFieldControlBase::MouseButtonDown( const MouseEvent& rMEvt ) void ScDPFieldControlBase::MouseButtonUp( const MouseEvent& rMEvt ) { - if( rMEvt.IsLeft() ) + if( eEndType != ENDTRACKING_DROP ) + mnFirstVisIndex = mnOldFirstVisIndex; + if( eEndType != ENDTRACKING_SUSPEND ) { if( rMEvt.GetClicks() == 1 ) { @@ -334,29 +336,60 @@ void ScDPFieldControlBase::MouseButtonUp( const MouseEvent& rMEvt ) if( IsMouseCaptured() ) ReleaseMouse(); } + mnInsCursorIndex = PIVOTFIELD_INVALID; + Invalidate(); } void ScDPFieldControlBase::MouseMove( const MouseEvent& rMEvt ) { - if( IsMouseCaptured() ) + // prepare a virtual device for buffered painting + VirtualDevice aVirDev; + // #i97623# VirtualDevice is always LTR on construction while other windows derive direction from parent + aVirDev.EnableRTL( IsRTLEnabled() ); + aVirDev.SetMapMode( MAP_PIXEL ); + aVirDev.SetOutputSizePixel( GetSizePixel() ); + Font aFont = GetFont(); + aFont.SetTransparent( true ); + aVirDev.SetFont( aFont ); + + // draw the background and all fields + DrawBackground( aVirDev ); + for( size_t nFieldIndex = mnFirstVisIndex, nEndIndex = mnFirstVisIndex + mnPageSize; nFieldIndex < nEndIndex; ++nFieldIndex ) + DrawField( aVirDev, nFieldIndex ); + DrawInsertionCursor( aVirDev ); + DrawBitmap( Point( 0, 0 ), aVirDev.GetBitmap( Point( 0, 0 ), GetSizePixel() ) ); + + // draw field text focus + if( HasFocus() && (mnSelectIndex < maFields.size()) && (mnFirstVisIndex <= mnSelectIndex) && (mnSelectIndex < mnFirstVisIndex + mnPageSize) ) { PointerStyle ePtr = mpDlg->NotifyMouseMove( OutputToScreenPixel( rMEvt.GetPosPixel() ) ); SetPointer( Pointer( ePtr ) ); } - size_t nIndex = 0; - if( GetFieldIndex( rMEvt.GetPosPixel(), nIndex ) && IsShortenedText( nIndex ) ) + + // update scrollbar + size_t nFieldCount = maFields.size(); + /* Already show the scrollbar if window is full but no fields are hidden + (yet). This gives the user the hint that it is now possible to add more + fields to the window. */ + mrScrollBar.Show( nFieldCount >= mnPageSize ); + mrScrollBar.Enable( nFieldCount > mnPageSize ); + if( mrScrollBar.IsVisible() ) { - Point aPos = OutputToScreenPixel( rMEvt.GetPosPixel() ); - Rectangle aRect( aPos, GetSizePixel() ); - String aHelpText = GetFieldText(nIndex); - Help::ShowQuickHelp( this, aRect, aHelpText ); + mrScrollBar.SetRange( Range( 0, static_cast< long >( (nFieldCount - 1) / mnLineSize + 1 ) ) ); + mrScrollBar.SetThumbPos( static_cast< long >( mnFirstVisIndex / mnLineSize ) ); } + + /* Exclude empty fields from tab chain, but do not disable them. They need + to be enabled because they still act as target for field movement via + keyboard shortcuts. */ + WinBits nMask = ~(WB_TABSTOP | WB_NOTABSTOP); + SetStyle( (GetStyle() & nMask) | (IsEmpty() ? WB_NOTABSTOP : WB_TABSTOP) ); } void ScDPFieldControlBase::KeyInput( const KeyEvent& rKEvt ) { const KeyCode& rKeyCode = rKEvt.GetKeyCode(); - USHORT nCode = rKeyCode.GetCode(); + sal_uInt16 nCode = rKeyCode.GetCode(); bool bKeyEvaluated = false; const FieldNames& rFields = GetFieldNames(); @@ -415,7 +448,7 @@ void ScDPFieldControlBase::GetFocus() ScrollToEnd(); } else // else change focus - mpDlg->NotifyFieldFocus( GetFieldType(), TRUE ); + mpDlg->NotifyFieldFocus( GetFieldType(), true ); AccessibleSetFocus(true); } @@ -424,7 +457,7 @@ void ScDPFieldControlBase::LoseFocus() { Control::LoseFocus(); Redraw(); - mpDlg->NotifyFieldFocus( GetFieldType(), FALSE ); + mpDlg->NotifyFieldFocus( GetFieldType(), false ); AccessibleSetFocus(false); } @@ -779,7 +812,7 @@ void ScDPHorFieldControl::Redraw() Point aPos0; Size aSize( GetSizePixel() ); Font aFont( GetFont() ); // Font vom Window - aFont.SetTransparent( TRUE ); + aFont.SetTransparent( true ); aVirDev.SetFont( aFont ); aVirDev.SetOutputSizePixel( aSize ); @@ -1095,6 +1128,11 @@ void ScDPRowFieldControl::Redraw() bool bFocus = HasFocus() && (nField == GetSelectedField()); DrawField(aVirDev, Rectangle(aFldPt, aFldSize), *itr, bFocus); } + + // draw the button text + Point aLabelOffset( (maFieldSize.Width() - nLabelWidth) / 2, ::std::max< long >( (maFieldSize.Height() - rDev.GetTextHeight()) / 2, 3 ) ); + rDev.SetTextColor( GetSettings().GetStyleSettings().GetButtonTextColor() ); + rDev.DrawText( aFieldPos + aLabelOffset, aClippedText ); } // Create a bitmap from the virtual device, and place that bitmap onto diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx index 82a8e8801b8b..03fd26ffd32e 100644 --- a/sc/source/ui/dbgui/filtdlg.cxx +++ b/sc/source/ui/dbgui/filtdlg.cxx @@ -115,14 +115,14 @@ ScFilterDlg::ScFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, pDoc ( NULL ), nSrcTab ( 0 ), nFieldCount ( 0 ), - bRefInputMode ( FALSE ), + bRefInputMode ( false ), pTimer ( NULL ) { - for (USHORT i=0; i<=MAXCOL; i++) + for (sal_uInt16 i=0; i<=MAXCOL; i++) pEntryLists[i] = NULL; for (SCSIZE i=0;i<MAXQUERY;i++) { - bRefreshExceptQuery[i]=FALSE; + bRefreshExceptQuery[i]=false; } aBtnMore.SetMoreText( String(ScResId( SCSTR_MOREBTN_MOREOPTIONS )) ); aBtnMore.SetLessText( String(ScResId( SCSTR_MOREBTN_FEWEROPTIONS )) ); @@ -133,6 +133,65 @@ ScFilterDlg::ScFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, pTimer = new Timer; pTimer->SetTimeout( 50 ); // 50ms warten pTimer->SetTimeoutHdl( LINK( this, ScFilterDlg, TimeOutHdl ) ); + + String sAccName (ScResId(RID_FILTER_OPERATOR)); + String sIndexName(sAccName); + sIndexName.AppendAscii (RTL_CONSTASCII_STRINGPARAM (" 1")); + aLbConnect1.SetAccessibleName(sIndexName); + sIndexName = sAccName; + sIndexName.AppendAscii (RTL_CONSTASCII_STRINGPARAM (" 2")); + aLbConnect2.SetAccessibleName(sIndexName); + + sAccName = String(ScResId(RID_FILTER_FIELDNAME)); + sIndexName = sAccName; + sIndexName.AppendAscii (RTL_CONSTASCII_STRINGPARAM (" 1")); + aLbField1.SetAccessibleName(sIndexName); + sIndexName = sAccName; + sIndexName.AppendAscii (RTL_CONSTASCII_STRINGPARAM (" 2")); + aLbField2.SetAccessibleName(sIndexName); + sIndexName = sAccName; + sIndexName.AppendAscii (RTL_CONSTASCII_STRINGPARAM (" 3")); + aLbField3.SetAccessibleName(sIndexName); + + + sAccName = String(ScResId(RID_FILTER_CONDITION)); + sIndexName = sAccName; + sIndexName.AppendAscii (RTL_CONSTASCII_STRINGPARAM (" 1")); + aLbCond1.SetAccessibleName(sIndexName); + sIndexName = sAccName; + sIndexName.AppendAscii (RTL_CONSTASCII_STRINGPARAM (" 2")); + aLbCond2.SetAccessibleName(sIndexName); + sIndexName = sAccName; + sIndexName.AppendAscii (RTL_CONSTASCII_STRINGPARAM (" 3")); + aLbCond3.SetAccessibleName(sIndexName); + + sAccName = String(ScResId(RID_FILTER_VALUE)); + sIndexName = sAccName; + sIndexName.AppendAscii (RTL_CONSTASCII_STRINGPARAM (" 1")); + aEdVal1.SetAccessibleName(sIndexName); + sIndexName = sAccName; + sIndexName.AppendAscii (RTL_CONSTASCII_STRINGPARAM (" 2")); + aEdVal2.SetAccessibleName(sIndexName); + sIndexName = sAccName; + sIndexName.AppendAscii (RTL_CONSTASCII_STRINGPARAM (" 3")); + aEdVal3.SetAccessibleName(sIndexName); + + aLbCopyArea.SetAccessibleName(ScResId(STR_COPY_AREA_TO)); + aEdCopyArea.SetAccessibleName(ScResId(STR_COPY_AREA_TO)); + aLbCopyArea.SetAccessibleRelationLabeledBy(&aBtnCopyResult); + aEdCopyArea.SetAccessibleRelationLabeledBy(&aBtnCopyResult); + + aLbConnect1.SetAccessibleRelationLabeledBy(&aFtConnect); + aLbConnect2.SetAccessibleRelationLabeledBy(&aFtConnect); + aLbField1.SetAccessibleRelationLabeledBy(&aFtField); + aLbField2.SetAccessibleRelationLabeledBy(&aFtField); + aLbField3.SetAccessibleRelationLabeledBy(&aFtField); + aLbCond1.SetAccessibleRelationLabeledBy(&aFtCond); + aLbCond2.SetAccessibleRelationLabeledBy(&aFtCond); + aLbCond3.SetAccessibleRelationLabeledBy(&aFtCond); + aEdVal1.SetAccessibleRelationLabeledBy(&aFtVal); + aEdVal2.SetAccessibleRelationLabeledBy(&aFtVal); + aEdVal3.SetAccessibleRelationLabeledBy(&aFtVal); } @@ -140,7 +199,7 @@ ScFilterDlg::ScFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, ScFilterDlg::~ScFilterDlg() { - for (USHORT i=0; i<=MAXCOL; i++) + for (sal_uInt16 i=0; i<=MAXCOL; i++) delete pEntryLists[i]; delete pOptionsMgr; @@ -230,13 +289,13 @@ void ScFilterDlg::Init( const SfxItemSet& rArgSet ) for ( SCSIZE i=0; i<4; i++ ) { String aValStr; - USHORT nCondPos = 0; - USHORT nFieldSelPos = 0; + sal_uInt16 nCondPos = 0; + sal_uInt16 nFieldSelPos = 0; ScQueryEntry& rEntry = theQueryData.GetEntry(i); if ( rEntry.bDoQuery ) { - nCondPos = (USHORT)rEntry.eOp; + nCondPos = (sal_uInt16)rEntry.eOp; nFieldSelPos = GetFieldSelPos( static_cast<SCCOL>(rEntry.nField) ); if ( rEntry.nVal == SC_EMPTYFIELDS && !rEntry.bQueryByString && *rEntry.pStr == EMPTY_STRING ) { @@ -256,15 +315,15 @@ void ScFilterDlg::Init( const SfxItemSet& rArgSet ) nFieldSelPos = GetFieldSelPos( pViewData->GetCurX() ); rEntry.nField = nFieldSelPos ? (theQueryData.nCol1 + static_cast<SCCOL>(nFieldSelPos) - 1) : static_cast<SCCOL>(0); - rEntry.bDoQuery=TRUE; - bRefreshExceptQuery[i]=TRUE; + rEntry.bDoQuery=sal_True; + bRefreshExceptQuery[i]=sal_True; } aFieldLbArr[i]->SelectEntryPos( nFieldSelPos ); aCondLbArr [i]->SelectEntryPos( nCondPos ); aValueEdArr[i]->SetText( aValStr ); aValueEdArr[i]->SetModifyHdl( LINK( this, ScFilterDlg, ValModifyHdl ) ); - UpdateValueList( static_cast<USHORT>(i+1) ); + UpdateValueList( static_cast<sal_uInt16>(i+1) ); } aScrollBar.SetEndScrollHdl( LINK( this, ScFilterDlg, ScrollHdl ) ); @@ -277,17 +336,17 @@ void ScFilterDlg::Init( const SfxItemSet& rArgSet ) (aLbField1.GetSelectEntryPos() != 0) && (aLbField2.GetSelectEntryPos() != 0) - ? aLbConnect2.SelectEntryPos( (USHORT)theQueryData.GetEntry(1).eConnect ) + ? aLbConnect2.SelectEntryPos( (sal_uInt16)theQueryData.GetEntry(1).eConnect ) : aLbConnect2.SetNoSelection(); (aLbField2.GetSelectEntryPos() != 0) && (aLbField3.GetSelectEntryPos() != 0) - ? aLbConnect3.SelectEntryPos( (USHORT)theQueryData.GetEntry(2).eConnect ) + ? aLbConnect3.SelectEntryPos( (sal_uInt16)theQueryData.GetEntry(2).eConnect ) : aLbConnect3.SetNoSelection(); (aLbField3.GetSelectEntryPos() != 0) && (aLbField4.GetSelectEntryPos() != 0) - ? aLbConnect4.SelectEntryPos( (USHORT)theQueryData.GetEntry(3).eConnect ) + ? aLbConnect4.SelectEntryPos( (sal_uInt16)theQueryData.GetEntry(3).eConnect ) : aLbConnect4.SetNoSelection(); if ( aLbField1.GetSelectEntryPos() == 0 ) { @@ -333,15 +392,15 @@ void ScFilterDlg::Init( const SfxItemSet& rArgSet ) if(pDoc!=NULL && pDoc->GetChangeTrack()!=NULL) aBtnCopyResult.Disable(); // Modal-Modus einschalten -// SetDispatcherLock( TRUE ); +// SetDispatcherLock( sal_True ); //@BugID 54702 Enablen/Disablen nur noch in Basisklasse -// SFX_APPWINDOW->Disable(FALSE); //! allgemeine Methode im ScAnyRefDlg +// SFX_APPWINDOW->Disable(sal_False); //! allgemeine Methode im ScAnyRefDlg } //---------------------------------------------------------------------------- -BOOL ScFilterDlg::Close() +sal_Bool ScFilterDlg::Close() { if (pViewData) pViewData->GetDocShell()->CancelAutoDBRange(); @@ -404,7 +463,7 @@ void ScFilterDlg::FillFieldLists() SCROW nFirstRow = theQueryData.nRow1; SCCOL nMaxCol = theQueryData.nCol2; SCCOL col = 0; - USHORT i=1; + sal_uInt16 i=1; for ( col=nFirstCol; col<=nMaxCol; col++ ) { @@ -428,13 +487,13 @@ void ScFilterDlg::FillFieldLists() //---------------------------------------------------------------------------- -void ScFilterDlg::UpdateValueList( USHORT nList ) +void ScFilterDlg::UpdateValueList( sal_uInt16 nList ) { if ( pDoc && nList>0 && nList<=4 ) { ComboBox* pValList = aValueEdArr[nList-1]; - USHORT nFieldSelPos = aFieldLbArr[nList-1]->GetSelectEntryPos(); - USHORT nListPos = 0; + sal_uInt16 nFieldSelPos = aFieldLbArr[nList-1]->GetSelectEntryPos(); + sal_uInt16 nListPos = 0; String aCurValue = pValList->GetText(); pValList->Clear(); @@ -449,7 +508,7 @@ void ScFilterDlg::UpdateValueList( USHORT nList ) SCCOL nColumn = theQueryData.nCol1 + static_cast<SCCOL>(nFieldSelPos) - 1; if (!pEntryLists[nColumn]) { - USHORT nOffset = GetSliderPos(); + sal_uInt16 nOffset = GetSliderPos(); SCTAB nTab = nSrcTab; SCROW nFirstRow = theQueryData.nRow1; SCROW nLastRow = theQueryData.bUseDynamicRange ? theQueryData.nDynamicEndRow : theQueryData.nRow2; @@ -486,10 +545,10 @@ void ScFilterDlg::UpdateValueList( USHORT nList ) } TypedScStrCollection* pColl = pEntryLists[nColumn]; - USHORT nValueCount = pColl->GetCount(); + sal_uInt16 nValueCount = pColl->GetCount(); if ( nValueCount > 0 ) { - for ( USHORT i=0; i<nValueCount; i++ ) + for ( sal_uInt16 i=0; i<nValueCount; i++ ) { pValList->InsertEntry( (*pColl)[i]->GetString(), nListPos ); nListPos++; @@ -503,30 +562,30 @@ void ScFilterDlg::UpdateValueList( USHORT nList ) UpdateHdrInValueList( nList ); } -void ScFilterDlg::UpdateHdrInValueList( USHORT nList ) +void ScFilterDlg::UpdateHdrInValueList( sal_uInt16 nList ) { //! GetText / SetText ?? if ( pDoc && nList>0 && nList<=4 ) { - USHORT nFieldSelPos = aFieldLbArr[nList-1]->GetSelectEntryPos(); + sal_uInt16 nFieldSelPos = aFieldLbArr[nList-1]->GetSelectEntryPos(); if ( nFieldSelPos ) { SCCOL nColumn = theQueryData.nCol1 + static_cast<SCCOL>(nFieldSelPos) - 1; if ( pEntryLists[nColumn] ) { - USHORT nPos = nHeaderPos[nColumn]; + sal_uInt16 nPos = nHeaderPos[nColumn]; if ( nPos != USHRT_MAX ) { ComboBox* pValList = aValueEdArr[nList-1]; - USHORT nListPos = nPos + 2; // nach "leer" und "nicht leer" + sal_uInt16 nListPos = nPos + 2; // nach "leer" und "nicht leer" TypedStrData* pHdrEntry = (*pEntryLists[nColumn])[nPos]; if ( pHdrEntry ) { String aHdrStr = pHdrEntry->GetString(); - BOOL bWasThere = ( pValList->GetEntry(nListPos) == aHdrStr ); - BOOL bInclude = !aBtnHeader.IsChecked(); + sal_Bool bWasThere = ( pValList->GetEntry(nListPos) == aHdrStr ); + sal_Bool bInclude = !aBtnHeader.IsChecked(); if (bInclude) // Eintrag aufnehmen { @@ -555,7 +614,7 @@ void ScFilterDlg::UpdateHdrInValueList( USHORT nList ) //---------------------------------------------------------------------------- -void ScFilterDlg::ClearValueList( USHORT nList ) +void ScFilterDlg::ClearValueList( sal_uInt16 nList ) { if ( nList>0 && nList<=4 ) { @@ -570,10 +629,10 @@ void ScFilterDlg::ClearValueList( USHORT nList ) //---------------------------------------------------------------------------- -USHORT ScFilterDlg::GetFieldSelPos( SCCOL nField ) +sal_uInt16 ScFilterDlg::GetFieldSelPos( SCCOL nField ) { if ( nField >= theQueryData.nCol1 && nField <= theQueryData.nCol2 ) - return static_cast<USHORT>(nField - theQueryData.nCol1 + 1); + return static_cast<sal_uInt16>(nField - theQueryData.nCol1 + 1); else return 0; } @@ -584,7 +643,7 @@ ScQueryItem* ScFilterDlg::GetOutputItem() { ScAddress theCopyPos; ScQueryParam theParam( theQueryData ); - BOOL bCopyPosOk = FALSE; + sal_Bool bCopyPosOk = false; if ( aBtnCopyResult.IsChecked() ) { @@ -594,27 +653,27 @@ ScQueryItem* ScFilterDlg::GetOutputItem() if ( STRING_NOTFOUND != nColonPos ) theCopyStr.Erase( nColonPos ); - USHORT nResult = theCopyPos.Parse( theCopyStr, pDoc, pDoc->GetAddressConvention() ); + sal_uInt16 nResult = theCopyPos.Parse( theCopyStr, pDoc, pDoc->GetAddressConvention() ); bCopyPosOk = ( SCA_VALID == (nResult & SCA_VALID) ); } if ( aBtnCopyResult.IsChecked() && bCopyPosOk ) { - theParam.bInplace = FALSE; + theParam.bInplace = false; theParam.nDestTab = theCopyPos.Tab(); theParam.nDestCol = theCopyPos.Col(); theParam.nDestRow = theCopyPos.Row(); } else { - theParam.bInplace = TRUE; + theParam.bInplace = sal_True; theParam.nDestTab = 0; theParam.nDestCol = 0; theParam.nDestRow = 0; } theParam.bHasHeader = aBtnHeader.IsChecked(); - theParam.bByRow = TRUE; + theParam.bByRow = sal_True; theParam.bDuplicate = !aBtnUnique.IsChecked(); theParam.bCaseSens = aBtnCase.IsChecked(); theParam.bRegExp = aBtnRegExp.IsChecked(); @@ -631,7 +690,7 @@ ScQueryItem* ScFilterDlg::GetOutputItem() //---------------------------------------------------------------------------- -BOOL ScFilterDlg::IsRefInputMode() const +sal_Bool ScFilterDlg::IsRefInputMode() const { return bRefInputMode; } @@ -645,24 +704,24 @@ IMPL_LINK( ScFilterDlg, EndDlgHdl, Button*, pBtn ) { if ( pBtn == &aBtnOk ) { - BOOL bAreaInputOk = TRUE; + sal_Bool bAreaInputOk = sal_True; if ( aBtnCopyResult.IsChecked() ) { if ( !pOptionsMgr->VerifyPosStr( aEdCopyArea.GetText() ) ) { if ( !aBtnMore.GetState() ) - aBtnMore.SetState( TRUE ); + aBtnMore.SetState( sal_True ); ERRORBOX( STR_INVALID_TABREF ); aEdCopyArea.GrabFocus(); - bAreaInputOk = FALSE; + bAreaInputOk = false; } } if ( bAreaInputOk ) { - SetDispatcherLock( FALSE ); + SetDispatcherLock( false ); SwitchToDocument(); GetBindings().GetDispatcher()->Execute( FID_FILTER_OK, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD, @@ -688,9 +747,9 @@ IMPL_LINK( ScFilterDlg, MoreClickHdl, MoreButton*, EMPTYARG ) else { pTimer->Stop(); - bRefInputMode = FALSE; + bRefInputMode = false; //@BugID 54702 Enablen/Disablen nur noch in Basisklasse - //SFX_APPWINDOW->Disable(FALSE); //! allgemeine Methode im ScAnyRefDlg + //SFX_APPWINDOW->Disable(sal_False); //! allgemeine Methode im ScAnyRefDlg } return 0; } @@ -720,7 +779,7 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb ) * Behandlung der Enable/Disable-Logik, * abhaengig davon, welche ListBox angefasst wurde: */ - USHORT nOffset = GetSliderPos(); + sal_uInt16 nOffset = GetSliderPos(); if ( pLb == &aLbConnect1 ) { @@ -728,10 +787,10 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb ) aLbCond1.Enable(); aEdVal1.Enable(); - USHORT nConnect1 = aLbConnect1.GetSelectEntryPos(); - USHORT nQE = nOffset; + sal_uInt16 nConnect1 = aLbConnect1.GetSelectEntryPos(); + sal_uInt16 nQE = nOffset; theQueryData.GetEntry(nQE).eConnect =(ScQueryConnect)nConnect1; - bRefreshExceptQuery[nQE]=TRUE; + bRefreshExceptQuery[nQE]=sal_True; } else if ( pLb == &aLbConnect2 ) @@ -740,10 +799,10 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb ) aLbCond2.Enable(); aEdVal2.Enable(); - USHORT nConnect2 = aLbConnect2.GetSelectEntryPos(); - USHORT nQE = 1+nOffset; + sal_uInt16 nConnect2 = aLbConnect2.GetSelectEntryPos(); + sal_uInt16 nQE = 1+nOffset; theQueryData.GetEntry(nQE).eConnect =(ScQueryConnect)nConnect2; - bRefreshExceptQuery[nQE]=TRUE; + bRefreshExceptQuery[nQE]=sal_True; } else if ( pLb == &aLbConnect3 ) { @@ -751,10 +810,10 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb ) aLbCond3.Enable(); aEdVal3.Enable(); - USHORT nConnect3 = aLbConnect3.GetSelectEntryPos(); - USHORT nQE = 2+nOffset; + sal_uInt16 nConnect3 = aLbConnect3.GetSelectEntryPos(); + sal_uInt16 nQE = 2+nOffset; theQueryData.GetEntry(nQE).eConnect = (ScQueryConnect)nConnect3; - bRefreshExceptQuery[nQE]=TRUE; + bRefreshExceptQuery[nQE]=sal_True; } else if ( pLb == &aLbConnect4 ) @@ -763,10 +822,10 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb ) aLbCond4.Enable(); aEdVal4.Enable(); - USHORT nConnect4 = aLbConnect4.GetSelectEntryPos(); - USHORT nQE = 3+nOffset; + sal_uInt16 nConnect4 = aLbConnect4.GetSelectEntryPos(); + sal_uInt16 nQE = 3+nOffset; theQueryData.GetEntry(nQE).eConnect = (ScQueryConnect)nConnect4; - bRefreshExceptQuery[nQE]=TRUE; + bRefreshExceptQuery[nQE]=sal_True; } else if ( pLb == &aLbField1 ) @@ -799,13 +858,13 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb ) aEdVal2.Disable(); aEdVal3.Disable(); aEdVal4.Disable(); - for (USHORT i= nOffset; i< MAXQUERY; i++) + for (sal_uInt16 i= nOffset; i< MAXQUERY; i++) { - theQueryData.GetEntry(i).bDoQuery = FALSE; - bRefreshExceptQuery[i]=FALSE; + theQueryData.GetEntry(i).bDoQuery = false; + bRefreshExceptQuery[i]=false; theQueryData.GetEntry(i).nField = static_cast<SCCOL>(0); } - bRefreshExceptQuery[nOffset] =TRUE; + bRefreshExceptQuery[nOffset] =sal_True; } else { @@ -814,8 +873,8 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb ) { aLbConnect2.Enable(); } - theQueryData.GetEntry(nOffset).bDoQuery = TRUE; - USHORT nField = pLb->GetSelectEntryPos(); + theQueryData.GetEntry(nOffset).bDoQuery = sal_True; + sal_uInt16 nField = pLb->GetSelectEntryPos(); theQueryData.GetEntry(nOffset).nField = theQueryData.nCol1 + static_cast<SCCOL>(nField) - 1 ; } } @@ -842,14 +901,14 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb ) aEdVal3.Disable(); aEdVal4.Disable(); - USHORT nTemp=nOffset+1; - for (USHORT i= nTemp; i< MAXQUERY; i++) + sal_uInt16 nTemp=nOffset+1; + for (sal_uInt16 i= nTemp; i< MAXQUERY; i++) { - theQueryData.GetEntry(i).bDoQuery = FALSE; - bRefreshExceptQuery[i]=FALSE; + theQueryData.GetEntry(i).bDoQuery = false; + bRefreshExceptQuery[i]=false; theQueryData.GetEntry(i).nField = static_cast<SCCOL>(0); } - bRefreshExceptQuery[nTemp]=TRUE; + bRefreshExceptQuery[nTemp]=sal_True; } else { @@ -858,9 +917,9 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb ) { aLbConnect3.Enable(); } - USHORT nField = pLb->GetSelectEntryPos(); - USHORT nQ=1+nOffset; - theQueryData.GetEntry(nQ).bDoQuery = TRUE; + sal_uInt16 nField = pLb->GetSelectEntryPos(); + sal_uInt16 nQ=1+nOffset; + theQueryData.GetEntry(nQ).bDoQuery = sal_True; theQueryData.GetEntry(nQ).nField = theQueryData.nCol1 + static_cast<SCCOL>(nField) - 1 ; } } @@ -879,14 +938,14 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb ) aLbCond4.Disable(); aEdVal4.Disable(); - USHORT nTemp=nOffset+2; - for (USHORT i= nTemp; i< MAXQUERY; i++) + sal_uInt16 nTemp=nOffset+2; + for (sal_uInt16 i= nTemp; i< MAXQUERY; i++) { - theQueryData.GetEntry(i).bDoQuery = FALSE; - bRefreshExceptQuery[i]=FALSE; + theQueryData.GetEntry(i).bDoQuery = false; + bRefreshExceptQuery[i]=false; theQueryData.GetEntry(i).nField = static_cast<SCCOL>(0); } - bRefreshExceptQuery[nTemp]=TRUE; + bRefreshExceptQuery[nTemp]=sal_True; } else { @@ -896,9 +955,9 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb ) aLbConnect4.Enable(); } - USHORT nField = pLb->GetSelectEntryPos(); - USHORT nQ=2+nOffset; - theQueryData.GetEntry(nQ).bDoQuery = TRUE; + sal_uInt16 nField = pLb->GetSelectEntryPos(); + sal_uInt16 nQ=2+nOffset; + theQueryData.GetEntry(nQ).bDoQuery = sal_True; theQueryData.GetEntry(nQ).nField = theQueryData.nCol1 + static_cast<SCCOL>(nField) - 1 ; } @@ -908,21 +967,21 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb ) if ( aLbField4.GetSelectEntryPos() == 0 ) { ClearValueList( 4 ); - USHORT nTemp=nOffset+3; - for (USHORT i= nTemp; i< MAXQUERY; i++) + sal_uInt16 nTemp=nOffset+3; + for (sal_uInt16 i= nTemp; i< MAXQUERY; i++) { - theQueryData.GetEntry(i).bDoQuery = FALSE; - bRefreshExceptQuery[i]=FALSE; + theQueryData.GetEntry(i).bDoQuery = false; + bRefreshExceptQuery[i]=false; theQueryData.GetEntry(i).nField = static_cast<SCCOL>(0); } - bRefreshExceptQuery[nTemp]=TRUE; + bRefreshExceptQuery[nTemp]=sal_True; } else { UpdateValueList( 4 ); - USHORT nField = pLb->GetSelectEntryPos(); - USHORT nQ=3+nOffset; - theQueryData.GetEntry(nQ).bDoQuery = TRUE; + sal_uInt16 nField = pLb->GetSelectEntryPos(); + sal_uInt16 nQ=3+nOffset; + theQueryData.GetEntry(nQ).bDoQuery = sal_True; theQueryData.GetEntry(nQ).nField = theQueryData.nCol1 + static_cast<SCCOL>(nField) - 1 ; } @@ -933,17 +992,17 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb ) } else if ( pLb == &aLbCond2) { - USHORT nQ=1+nOffset; + sal_uInt16 nQ=1+nOffset; theQueryData.GetEntry(nQ).eOp=(ScQueryOp)pLb->GetSelectEntryPos(); } else if ( pLb == &aLbCond3) { - USHORT nQ=2+nOffset; + sal_uInt16 nQ=2+nOffset; theQueryData.GetEntry(nQ).eOp=(ScQueryOp)pLb->GetSelectEntryPos(); } else { - USHORT nQ=3+nOffset; + sal_uInt16 nQ=3+nOffset; theQueryData.GetEntry(nQ).eOp=(ScQueryOp)pLb->GetSelectEntryPos(); } @@ -963,10 +1022,10 @@ IMPL_LINK( ScFilterDlg, CheckBoxHdl, CheckBox*, pBox ) if ( pBox == &aBtnHeader ) // Feldlisten und Wertlisten { - USHORT nCurSel1 = aLbField1.GetSelectEntryPos(); - USHORT nCurSel2 = aLbField2.GetSelectEntryPos(); - USHORT nCurSel3 = aLbField3.GetSelectEntryPos(); - USHORT nCurSel4 = aLbField4.GetSelectEntryPos(); + sal_uInt16 nCurSel1 = aLbField1.GetSelectEntryPos(); + sal_uInt16 nCurSel2 = aLbField2.GetSelectEntryPos(); + sal_uInt16 nCurSel3 = aLbField3.GetSelectEntryPos(); + sal_uInt16 nCurSel4 = aLbField4.GetSelectEntryPos(); FillFieldLists(); aLbField1.SelectEntryPos( nCurSel1 ); aLbField2.SelectEntryPos( nCurSel2 ); @@ -981,7 +1040,7 @@ IMPL_LINK( ScFilterDlg, CheckBoxHdl, CheckBox*, pBox ) if ( pBox == &aBtnCase ) // Wertlisten komplett { - for (USHORT i=0; i<=MAXCOL; i++) + for (sal_uInt16 i=0; i<=MAXCOL; i++) DELETEZ( pEntryLists[i] ); UpdateValueList( 1 ); // aktueller Text wird gemerkt @@ -998,9 +1057,9 @@ IMPL_LINK( ScFilterDlg, CheckBoxHdl, CheckBox*, pBox ) IMPL_LINK( ScFilterDlg, ValModifyHdl, ComboBox*, pEd ) { - USHORT nOffset = GetSliderPos(); - USHORT i=0; - USHORT nQE =i + nOffset; + sal_uInt16 nOffset = GetSliderPos(); + sal_uInt16 i=0; + sal_uInt16 nQE =i + nOffset; if ( pEd ) { String aStrVal = pEd->GetText(); @@ -1037,7 +1096,7 @@ IMPL_LINK( ScFilterDlg, ValModifyHdl, ComboBox*, pEd ) pLbCond->Enable(); ScQueryEntry& rEntry = theQueryData.GetEntry( nQE ); - BOOL bDoThis = (pLbField->GetSelectEntryPos() != 0); + sal_Bool bDoThis = (pLbField->GetSelectEntryPos() != 0); rEntry.bDoQuery = bDoThis; if ( rEntry.bDoQuery || bRefreshExceptQuery[nQE] ) @@ -1046,22 +1105,22 @@ IMPL_LINK( ScFilterDlg, ValModifyHdl, ComboBox*, pEd ) { rEntry.pStr->Erase(); rEntry.nVal = SC_EMPTYFIELDS; - rEntry.bQueryByString = FALSE; + rEntry.bQueryByString = false; } else if ( aStrVal == aStrNotEmpty ) { rEntry.pStr->Erase(); rEntry.nVal = SC_NONEMPTYFIELDS; - rEntry.bQueryByString = FALSE; + rEntry.bQueryByString = false; } else { *rEntry.pStr = aStrVal; rEntry.nVal = 0; - rEntry.bQueryByString = TRUE; + rEntry.bQueryByString = sal_True; } - USHORT nField = pLbField->GetSelectEntryPos(); + sal_uInt16 nField = pLbField->GetSelectEntryPos(); rEntry.nField = nField ? (theQueryData.nCol1 + static_cast<SCCOL>(nField) - 1) : static_cast<SCCOL>(0); @@ -1083,31 +1142,31 @@ IMPL_LINK( ScFilterDlg, ScrollHdl, ScrollBar*, EMPTYARG ) void ScFilterDlg::SliderMoved() { - USHORT nOffset = GetSliderPos(); + sal_uInt16 nOffset = GetSliderPos(); RefreshEditRow( nOffset); } -USHORT ScFilterDlg::GetSliderPos() +sal_uInt16 ScFilterDlg::GetSliderPos() { - return (USHORT) aScrollBar.GetThumbPos(); + return (sal_uInt16) aScrollBar.GetThumbPos(); } -void ScFilterDlg::RefreshEditRow( USHORT nOffset ) +void ScFilterDlg::RefreshEditRow( sal_uInt16 nOffset ) { if (nOffset==0) aConnLbArr[0]->Hide(); else aConnLbArr[0]->Show(); - for ( USHORT i=0; i<4; i++ ) + for ( sal_uInt16 i=0; i<4; i++ ) { String aValStr; - USHORT nCondPos = 0; - USHORT nFieldSelPos = 0; - USHORT nQE = i+nOffset; + sal_uInt16 nCondPos = 0; + sal_uInt16 nFieldSelPos = 0; + sal_uInt16 nQE = i+nOffset; ScQueryEntry& rEntry = theQueryData.GetEntry( nQE); if ( rEntry.bDoQuery || bRefreshExceptQuery[nQE] ) { - nCondPos = (USHORT)rEntry.eOp; + nCondPos = (sal_uInt16)rEntry.eOp; if(rEntry.bDoQuery) nFieldSelPos = GetFieldSelPos( static_cast<SCCOL>(rEntry.nField) ); @@ -1137,9 +1196,9 @@ void ScFilterDlg::RefreshEditRow( USHORT nOffset ) aConnLbArr[i+1]->Enable(); else aConnLbArr[i+1]->Disable(); - USHORT nQENext = nQE+1; + sal_uInt16 nQENext = nQE+1; if(theQueryData.GetEntry(nQENext).bDoQuery || bRefreshExceptQuery[nQENext]) - aConnLbArr[i+1]->SelectEntryPos( (USHORT) theQueryData.GetEntry(nQENext).eConnect ); + aConnLbArr[i+1]->SelectEntryPos( (sal_uInt16) theQueryData.GetEntry(nQENext).eConnect ); else aConnLbArr[i+1]->SetNoSelection(); } @@ -1152,7 +1211,7 @@ void ScFilterDlg::RefreshEditRow( USHORT nOffset ) aConnLbArr[i]->Disable(); if(rEntry.bDoQuery || bRefreshExceptQuery[nQE]) - aConnLbArr[i]->SelectEntryPos( (USHORT) rEntry.eConnect ); + aConnLbArr[i]->SelectEntryPos( (sal_uInt16) rEntry.eConnect ); else aConnLbArr[i]->SetNoSelection(); } @@ -1183,7 +1242,7 @@ void ScFilterDlg::RefreshEditRow( USHORT nOffset ) aFieldLbArr[i]->SelectEntryPos( nFieldSelPos ); aCondLbArr [i]->SelectEntryPos( nCondPos ); aValueEdArr[i]->SetText( aValStr ); - UpdateValueList( static_cast<USHORT>(i+1) ); + UpdateValueList( static_cast<sal_uInt16>(i+1) ); } } diff --git a/sc/source/ui/dbgui/foptmgr.cxx b/sc/source/ui/dbgui/foptmgr.cxx index d6b331494667..d6f9d28b98ea 100644 --- a/sc/source/ui/dbgui/foptmgr.cxx +++ b/sc/source/ui/dbgui/foptmgr.cxx @@ -99,8 +99,8 @@ ScFilterOptionsMgr::ScFilterOptionsMgr( ScFilterOptionsMgr::~ScFilterOptionsMgr() { - USHORT nEntries = rLbCopyPos.GetEntryCount(); - USHORT i; + sal_uInt16 nEntries = rLbCopyPos.GetEntryCount(); + sal_uInt16 i; for ( i=2; i<nEntries; i++ ) delete (String*)rLbCopyPos.GetEntryData( i ); @@ -162,13 +162,13 @@ void ScFilterOptionsMgr::Init() String aRefStr; while ( aIter.Next( aName, aRange ) ) { - USHORT nInsert = rLbCopyPos.InsertEntry( aName ); + sal_uInt16 nInsert = rLbCopyPos.InsertEntry( aName ); aRange.aStart.Format( aRefStr, SCA_ABS_3D, pDoc, eConv ); rLbCopyPos.SetEntryData( nInsert, new String( aRefStr ) ); } - rBtnDestPers.Check( TRUE ); // beim Aufruf immer an + rBtnDestPers.Check( sal_True ); // beim Aufruf immer an rLbCopyPos.SelectEntryPos( 0 ); rEdCopyPos.SetText( EMPTY_STRING ); @@ -215,7 +215,7 @@ void ScFilterOptionsMgr::Init() rQueryData.nDestTab ).Format( aString, SCA_ABS_3D, pDoc, eConv ); - rBtnCopyResult.Check( TRUE ); + rBtnCopyResult.Check( sal_True ); rEdCopyPos.SetText( aString ); EdPosModifyHdl( &rEdCopyPos ); rLbCopyPos.Enable(); @@ -225,7 +225,7 @@ void ScFilterOptionsMgr::Init() } else { - rBtnCopyResult.Check( FALSE ); + rBtnCopyResult.Check( false ); rEdCopyPos.SetText( EMPTY_STRING ); rLbCopyPos.Disable(); rEdCopyPos.Disable(); @@ -240,7 +240,7 @@ void ScFilterOptionsMgr::Init() //---------------------------------------------------------------------------- -BOOL ScFilterOptionsMgr::VerifyPosStr( const String& rPosStr ) const +sal_Bool ScFilterOptionsMgr::VerifyPosStr( const String& rPosStr ) const { String aPosStr( rPosStr ); xub_StrLen nColonPos = aPosStr.Search( ':' ); @@ -248,7 +248,7 @@ BOOL ScFilterOptionsMgr::VerifyPosStr( const String& rPosStr ) const if ( STRING_NOTFOUND != nColonPos ) aPosStr.Erase( nColonPos ); - USHORT nResult = ScAddress().Parse( aPosStr, pDoc, pDoc->GetAddressConvention() ); + sal_uInt16 nResult = ScAddress().Parse( aPosStr, pDoc, pDoc->GetAddressConvention() ); return ( SCA_VALID == (nResult & SCA_VALID) ); } @@ -264,7 +264,7 @@ IMPL_LINK( ScFilterOptionsMgr, LbPosSelHdl, ListBox*, pLb ) if ( pLb == &rLbCopyPos ) { String aString; - USHORT nSelPos = rLbCopyPos.GetSelectEntryPos(); + sal_uInt16 nSelPos = rLbCopyPos.GetSelectEntryPos(); if ( nSelPos > 0 ) aString = *(String*)rLbCopyPos.GetEntryData( nSelPos ); @@ -283,14 +283,14 @@ IMPL_LINK( ScFilterOptionsMgr, EdPosModifyHdl, Edit*, pEd ) if ( pEd == &rEdCopyPos ) { String theCurPosStr = pEd->GetText(); - USHORT nResult = ScAddress().Parse( theCurPosStr, pDoc, pDoc->GetAddressConvention() ); + sal_uInt16 nResult = ScAddress().Parse( theCurPosStr, pDoc, pDoc->GetAddressConvention() ); if ( SCA_VALID == (nResult & SCA_VALID) ) { String* pStr = NULL; - BOOL bFound = FALSE; - USHORT i = 0; - USHORT nCount = rLbCopyPos.GetEntryCount(); + sal_Bool bFound = false; + sal_uInt16 i = 0; + sal_uInt16 nCount = rLbCopyPos.GetEntryCount(); for ( i=2; i<nCount && !bFound; i++ ) { diff --git a/sc/source/ui/dbgui/imoptdlg.cxx b/sc/source/ui/dbgui/imoptdlg.cxx index 641ce7dc6374..56946006ce02 100644 --- a/sc/source/ui/dbgui/imoptdlg.cxx +++ b/sc/source/ui/dbgui/imoptdlg.cxx @@ -45,19 +45,43 @@ static const sal_Char pStrFix[] = "FIX"; ScImportOptions::ScImportOptions( const String& rStr ) { - bFixedWidth = FALSE; + // Use the same string format as ScAsciiOptions, + // because the import options string is passed here when a CSV file is loaded and saved again. + // The old format is still supported because it might be used in macros. + + bFixedWidth = false; nFieldSepCode = 0; - if ( rStr.GetTokenCount(',') >= 3 ) + nTextSepCode = 0; + eCharSet = RTL_TEXTENCODING_DONTKNOW; + bSaveAsShown = sal_True; // "true" if not in string (after CSV import) + bQuoteAllText = false; + xub_StrLen nTokenCount = rStr.GetTokenCount(','); + if ( nTokenCount >= 3 ) { + // first 3 tokens: common String aToken( rStr.GetToken( 0, ',' ) ); if( aToken.EqualsIgnoreCaseAscii( pStrFix ) ) - bFixedWidth = TRUE; + bFixedWidth = sal_True; else nFieldSepCode = (sal_Unicode) aToken.ToInt32(); nTextSepCode = (sal_Unicode) rStr.GetToken(1,',').ToInt32(); aStrFont = rStr.GetToken(2,','); eCharSet = ScGlobal::GetCharsetValue(aStrFont); - bSaveAsShown = (rStr.GetToken( 3, ',' ).ToInt32() ? TRUE : FALSE); + + if ( nTokenCount == 4 ) + { + // compatibility with old options string: "Save as shown" as 4th token, numeric + bSaveAsShown = (rStr.GetToken( 3, ',' ).ToInt32() ? sal_True : false); + bQuoteAllText = sal_True; // use old default then + } + else + { + // look at the same positions as in ScAsciiOptions + if ( nTokenCount >= 7 ) + bQuoteAllText = rStr.GetToken(6, ',').EqualsAscii("true"); + if ( nTokenCount >= 9 ) + bSaveAsShown = rStr.GetToken(8, ',').EqualsAscii("true"); + } } } @@ -75,8 +99,11 @@ String ScImportOptions::BuildString() const aResult += String::CreateFromInt32(nTextSepCode); aResult += ','; aResult += aStrFont; - aResult += ','; - aResult += String::CreateFromInt32( bSaveAsShown ? 1 : 0 ); + // use the same string format as ScAsciiOptions: + aResult.AppendAscii( ",1,,0," ); // first row, no column info, default language + aResult.AppendAscii(bQuoteAllText ? "true" : "false"); // same as "quoted field as text" in ScAsciiOptions + aResult.AppendAscii( ",true," ); // "detect special numbers" + aResult.AppendAscii(bSaveAsShown ? "true" : "false"); // "save as shown": not in ScAsciiOptions return aResult; } diff --git a/sc/source/ui/dbgui/imoptdlg.src b/sc/source/ui/dbgui/imoptdlg.src index b63d83210c00..8f6839533851 100644 --- a/sc/source/ui/dbgui/imoptdlg.src +++ b/sc/source/ui/dbgui/imoptdlg.src @@ -44,6 +44,7 @@ ModalDialog RID_SCDLG_IMPORTOPT }; ComboBox ED_FIELDSEP { + HelpID = "sc:ComboBox:RID_SCDLG_IMPORTOPT:ED_FIELDSEP"; Pos = MAP_APPFONT ( 70 , 30 ) ; Size = MAP_APPFONT ( 121 , 60 ) ; DropDown = TRUE ; @@ -56,6 +57,7 @@ ModalDialog RID_SCDLG_IMPORTOPT }; ComboBox ED_TEXTSEP { + HelpID = "sc:ComboBox:RID_SCDLG_IMPORTOPT:ED_TEXTSEP"; Pos = MAP_APPFONT ( 70 , 46 ) ; Size = MAP_APPFONT ( 121 , 60 ) ; DropDown = TRUE ; @@ -68,6 +70,7 @@ ModalDialog RID_SCDLG_IMPORTOPT }; ListBox DDLB_FONT { + HelpID = "sc:ListBox:RID_SCDLG_IMPORTOPT:DDLB_FONT"; Border = TRUE; Sort = TRUE; DropDown = TRUE ; @@ -76,6 +79,7 @@ ModalDialog RID_SCDLG_IMPORTOPT }; ListBox LB_FONT { + HelpID = "sc:ListBox:RID_SCDLG_IMPORTOPT:LB_FONT"; Border = TRUE; Sort = TRUE; DropDown = FALSE ; @@ -90,7 +94,8 @@ ModalDialog RID_SCDLG_IMPORTOPT }; CheckBox CB_FIXEDWIDTH { - Pos = MAP_APPFONT( 12, 80 ); + HelpID = "sc:CheckBox:RID_SCDLG_IMPORTOPT:CB_FIXEDWIDTH"; + Pos = MAP_APPFONT( 12, 92 ); Size = MAP_APPFONT( 172, 10 ); Hide = TRUE; Text [ en-US ] = "Fixed column ~width"; @@ -103,6 +108,14 @@ ModalDialog RID_SCDLG_IMPORTOPT Hide = TRUE; Text [ en-US ] = "Save cell content as ~shown"; }; + CheckBox CB_QUOTEALL + { + HelpID = "sc:CheckBox:RID_SCDLG_IMPORTOPT:CB_QUOTEALL"; + Pos = MAP_APPFONT( 20, 64 ); + Size = MAP_APPFONT( 164, 10 ); + Hide = TRUE; + Text [ en-US ] = "~Quote all text cells"; + }; OKButton BTN_OK { Pos = MAP_APPFONT ( 202 , 6 ) ; diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx index 55ce7b9499b7..5cdf37116f13 100644 --- a/sc/source/ui/dbgui/pfiltdlg.cxx +++ b/sc/source/ui/dbgui/pfiltdlg.cxx @@ -106,7 +106,7 @@ ScPivotFilterDlg::ScPivotFilterDlg( Window* pParent, nSrcTab ( nSourceTab ), // ist nicht im QueryParam nFieldCount ( 0 ) { - for (USHORT i=0; i<=MAXCOL; i++) + for (sal_uInt16 i=0; i<=MAXCOL; i++) pEntryLists[i] = NULL; Init( rArgSet ); @@ -117,7 +117,7 @@ ScPivotFilterDlg::ScPivotFilterDlg( Window* pParent, ScPivotFilterDlg::~ScPivotFilterDlg() { - for (USHORT i=0; i<=MAXCOL; i++) + for (sal_uInt16 i=0; i<=MAXCOL; i++) delete pEntryLists[i]; if ( pOutItem ) @@ -223,12 +223,12 @@ void ScPivotFilterDlg::Init( const SfxItemSet& rArgSet ) else if (rEntry.nVal == SC_NONEMPTYFIELDS) aValStr = aStrNotEmpty; } - USHORT nCondPos = (USHORT)rEntry.eOp; - USHORT nFieldSelPos = GetFieldSelPos( static_cast<SCCOL>(rEntry.nField) ); + sal_uInt16 nCondPos = (sal_uInt16)rEntry.eOp; + sal_uInt16 nFieldSelPos = GetFieldSelPos( static_cast<SCCOL>(rEntry.nField) ); aFieldLbArr[i]->SelectEntryPos( nFieldSelPos ); aCondLbArr [i]->SelectEntryPos( nCondPos ); - UpdateValueList( static_cast<USHORT>(i+1) ); + UpdateValueList( static_cast<sal_uInt16>(i+1) ); aValueEdArr[i]->SetText( aValStr ); if (aValStr == aStrEmpty || aValStr == aStrNotEmpty) aCondLbArr[i]->Disable(); @@ -237,7 +237,7 @@ void ScPivotFilterDlg::Init( const SfxItemSet& rArgSet ) { aFieldLbArr[i]->SelectEntryPos( 0 ); // "keiner" selektieren aCondLbArr [i]->SelectEntryPos( 0 ); // "=" selektieren - UpdateValueList( static_cast<USHORT>(i) ); + UpdateValueList( static_cast<sal_uInt16>(i) ); aValueEdArr[i]->SetText( EMPTY_STRING ); } aValueEdArr[i]->SetModifyHdl( LINK( this, ScPivotFilterDlg, ValModifyHdl ) ); @@ -247,12 +247,12 @@ void ScPivotFilterDlg::Init( const SfxItemSet& rArgSet ) (aLbField1.GetSelectEntryPos() != 0) && (aLbField2.GetSelectEntryPos() != 0) - ? aLbConnect1.SelectEntryPos( (USHORT)theQueryData.GetEntry(1).eConnect ) + ? aLbConnect1.SelectEntryPos( (sal_uInt16)theQueryData.GetEntry(1).eConnect ) : aLbConnect1.SetNoSelection(); (aLbField2.GetSelectEntryPos() != 0) && (aLbField3.GetSelectEntryPos() != 0) - ? aLbConnect2.SelectEntryPos( (USHORT)theQueryData.GetEntry(2).eConnect ) + ? aLbConnect2.SelectEntryPos( (sal_uInt16)theQueryData.GetEntry(2).eConnect ) : aLbConnect2.SetNoSelection(); if ( aLbField1.GetSelectEntryPos() == 0 ) @@ -303,7 +303,7 @@ void ScPivotFilterDlg::FillFieldLists() SCROW nFirstRow = theQueryData.nRow1; SCCOL nMaxCol = theQueryData.nCol2; SCCOL col = 0; - USHORT i=1; + sal_uInt16 i=1; for ( col=nFirstCol; col<=nMaxCol; col++ ) { @@ -325,13 +325,13 @@ void ScPivotFilterDlg::FillFieldLists() //------------------------------------------------------------------------ -void ScPivotFilterDlg::UpdateValueList( USHORT nList ) +void ScPivotFilterDlg::UpdateValueList( sal_uInt16 nList ) { if ( pDoc && nList>0 && nList<=3 ) { ComboBox* pValList = aValueEdArr[nList-1]; - USHORT nFieldSelPos = aFieldLbArr[nList-1]->GetSelectEntryPos(); - USHORT nListPos = 0; + sal_uInt16 nFieldSelPos = aFieldLbArr[nList-1]->GetSelectEntryPos(); + sal_uInt16 nListPos = 0; String aCurValue = pValList->GetText(); pValList->Clear(); @@ -359,10 +359,10 @@ void ScPivotFilterDlg::UpdateValueList( USHORT nList ) } TypedScStrCollection* pColl = pEntryLists[nColumn]; - USHORT nValueCount = pColl->GetCount(); + sal_uInt16 nValueCount = pColl->GetCount(); if ( nValueCount > 0 ) { - for ( USHORT i=0; i<nValueCount; i++ ) + for ( sal_uInt16 i=0; i<nValueCount; i++ ) { pValList->InsertEntry( (*pColl)[i]->GetString(), nListPos ); nListPos++; @@ -375,7 +375,7 @@ void ScPivotFilterDlg::UpdateValueList( USHORT nList ) //------------------------------------------------------------------------ -void ScPivotFilterDlg::ClearValueList( USHORT nList ) +void ScPivotFilterDlg::ClearValueList( sal_uInt16 nList ) { if ( nList>0 && nList<=3 ) { @@ -389,10 +389,10 @@ void ScPivotFilterDlg::ClearValueList( USHORT nList ) //------------------------------------------------------------------------ -USHORT ScPivotFilterDlg::GetFieldSelPos( SCCOL nField ) +sal_uInt16 ScPivotFilterDlg::GetFieldSelPos( SCCOL nField ) { if ( nField >= theQueryData.nCol1 && nField <= theQueryData.nCol2 ) - return static_cast<USHORT>(nField - theQueryData.nCol1 + 1); + return static_cast<sal_uInt16>(nField - theQueryData.nCol1 + 1); else return 0; } @@ -402,15 +402,15 @@ USHORT ScPivotFilterDlg::GetFieldSelPos( SCCOL nField ) const ScQueryItem& ScPivotFilterDlg::GetOutputItem() { ScQueryParam theParam( theQueryData ); - USHORT nConnect1 = aLbConnect1.GetSelectEntryPos(); - USHORT nConnect2 = aLbConnect2.GetSelectEntryPos(); + sal_uInt16 nConnect1 = aLbConnect1.GetSelectEntryPos(); + sal_uInt16 nConnect2 = aLbConnect2.GetSelectEntryPos(); for ( SCSIZE i=0; i<3; i++ ) { - USHORT nField = aFieldLbArr[i]->GetSelectEntryPos(); + sal_uInt16 nField = aFieldLbArr[i]->GetSelectEntryPos(); ScQueryOp eOp = (ScQueryOp)aCondLbArr[i]->GetSelectEntryPos(); - BOOL bDoThis = (aFieldLbArr[i]->GetSelectEntryPos() != 0); + sal_Bool bDoThis = (aFieldLbArr[i]->GetSelectEntryPos() != 0); theParam.GetEntry(i).bDoQuery = bDoThis; if ( bDoThis ) @@ -428,19 +428,19 @@ const ScQueryItem& ScPivotFilterDlg::GetOutputItem() { *rEntry.pStr = EMPTY_STRING; rEntry.nVal = SC_EMPTYFIELDS; - rEntry.bQueryByString = FALSE; + rEntry.bQueryByString = false; } else if ( aStrVal == aStrNotEmpty ) { *rEntry.pStr = EMPTY_STRING; rEntry.nVal = SC_NONEMPTYFIELDS; - rEntry.bQueryByString = FALSE; + rEntry.bQueryByString = false; } else { *rEntry.pStr = aStrVal; rEntry.nVal = 0; - rEntry.bQueryByString = TRUE; + rEntry.bQueryByString = sal_True; } rEntry.nField = nField ? (theQueryData.nCol1 + @@ -456,7 +456,7 @@ const ScQueryItem& ScPivotFilterDlg::GetOutputItem() ? (ScQueryConnect)nConnect2 : SC_AND; - theParam.bInplace = FALSE; + theParam.bInplace = false; theParam.nDestTab = 0; // Woher kommen diese Werte? theParam.nDestCol = 0; theParam.nDestRow = 0; @@ -574,7 +574,7 @@ IMPL_LINK( ScPivotFilterDlg, CheckBoxHdl, CheckBox*, pBox ) if ( pBox == &aBtnCase ) // Wertlisten { - for (USHORT i=0; i<=MAXCOL; i++) + for (sal_uInt16 i=0; i<=MAXCOL; i++) DELETEZ( pEntryLists[i] ); String aCurVal1 = aEdVal1.GetText(); diff --git a/sc/source/ui/dbgui/pivot.hrc b/sc/source/ui/dbgui/pivot.hrc index 883be5e7f4c8..244be15649ec 100644 --- a/sc/source/ui/dbgui/pivot.hrc +++ b/sc/source/ui/dbgui/pivot.hrc @@ -34,8 +34,12 @@ #define BTN_OPTIONS 6 #define FL_LAYOUT 10 +#define FL_SELECT 90 +#define SCROLL_COL 91 #define WND_COL 11 +#define SCROLL_ROW 92 #define WND_ROW 12 +#define SCROLL_DATA 93 #define WND_DATA 13 #define WND_SELECT 14 #define WND_PAGE 18 diff --git a/sc/source/ui/dbgui/pivot.src b/sc/source/ui/dbgui/pivot.src index 514a37153ab0..423c7df6e547 100644 --- a/sc/source/ui/dbgui/pivot.src +++ b/sc/source/ui/dbgui/pivot.src @@ -36,7 +36,7 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT SVLook = TRUE ; Moveable = TRUE ; Closeable = FALSE ; - Text [ en-US ] = "DataPilot" ; + Text [ en-US ] = "Pivot Table" ; FixedText FT_PAGE { @@ -44,6 +44,13 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT Size = MAP_APPFONT ( 37 , 8 ) ; Text[ en-US ] = "Page Fields" ; }; + ScrollBar SCROLL_PAGE + { + Pos = MAP_APPFONT ( 198 , 14 ) ; + Size = MAP_APPFONT ( 8 , 24 ) ; + HScroll = FALSE ; + TabStop = FALSE ; + }; Control WND_PAGE { /* Size is calculated in the dialog code. */ @@ -57,6 +64,13 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT Size = MAP_APPFONT ( 37 , 8 ) ; Text [ en-US ] = "Column Fields" ; }; + ScrollBar SCROLL_COL + { + Pos = MAP_APPFONT ( 198 , 42 ) ; + Size = MAP_APPFONT ( 8 , 24 ) ; + HScroll = FALSE ; + TabStop = FALSE ; + }; Control WND_COL { /* Size is calculated in the dialog code. */ @@ -70,6 +84,13 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT Size = MAP_APPFONT ( 37 , 8 ) ; Text [ en-US ] = "Row\nFields" ; }; + ScrollBar SCROLL_ROW + { + Pos = MAP_APPFONT ( 42 , 70 ) ; + Size = MAP_APPFONT ( 8 , 96 ) ; + HScroll = FALSE ; + TabStop = FALSE ; + }; Control WND_ROW { /* Size is calculated in the dialog code. */ @@ -83,6 +104,13 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT Size = MAP_APPFONT ( 37 , 8 ) ; Text [ en-US ] = "Data Fields" ; }; + ScrollBar SCROLL_DATA + { + Pos = MAP_APPFONT ( 198 , 70 ) ; + Size = MAP_APPFONT ( 8 , 96 ) ; + HScroll = FALSE ; + TabStop = FALSE ; + }; Control WND_DATA { /* Size is calculated in the dialog code. */ @@ -114,6 +142,12 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT Size = MAP_APPFONT ( 282 , 8 ) ; Text [ en-US ] = "Layout"; }; + FixedLine FL_SELECT + { + Pos = MAP_APPFONT ( 212 , 3 ) ; + Size = MAP_APPFONT ( 74 , 8 ) ; + Text [ en-US ] = "Fields"; + }; OKButton BTN_OK { Pos = MAP_APPFONT ( 294 , 6 ) ; @@ -172,6 +206,7 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT }; Edit ED_INAREA { + HelpID = "sc:Edit:RID_SCDLG_PIVOT_LAYOUT:ED_INAREA"; Border = TRUE ; Pos = MAP_APPFONT ( 73 , 227 ) ; Size = MAP_APPFONT ( 100 , 12 ) ; @@ -196,6 +231,7 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT }; ListBox LB_OUTAREA { + HelpID = "sc:ListBox:RID_SCDLG_PIVOT_LAYOUT:LB_OUTAREA"; Border = TRUE ; Pos = MAP_APPFONT ( 73 , 245 ) ; Size = MAP_APPFONT ( 75 , 90 ) ; @@ -205,6 +241,7 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT }; Edit ED_OUTAREA { + HelpID = "sc:Edit:RID_SCDLG_PIVOT_LAYOUT:ED_OUTAREA"; Border = TRUE ; Pos = MAP_APPFONT ( 152 , 245 ) ; Size = MAP_APPFONT ( 100 , 12 ) ; diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx index f0da7090a2a4..403ae802fc1e 100644 --- a/sc/source/ui/dbgui/pvfundlg.cxx +++ b/sc/source/ui/dbgui/pvfundlg.cxx @@ -70,7 +70,7 @@ namespace { @return true = The passed string list contains an empty string entry. */ template< typename ListBoxType > -bool lclFillListBox( ListBoxType& rLBox, const Sequence< OUString >& rStrings, USHORT nEmptyPos = LISTBOX_APPEND ) +bool lclFillListBox( ListBoxType& rLBox, const Sequence< OUString >& rStrings, sal_uInt16 nEmptyPos = LISTBOX_APPEND ) { bool bEmpty = false; const OUString* pStr = rStrings.getConstArray(); @@ -91,7 +91,7 @@ bool lclFillListBox( ListBoxType& rLBox, const Sequence< OUString >& rStrings, U } template< typename ListBoxType > -bool lclFillListBox( ListBoxType& rLBox, const vector<ScDPLabelData::Member>& rMembers, USHORT nEmptyPos = LISTBOX_APPEND ) +bool lclFillListBox( ListBoxType& rLBox, const vector<ScDPLabelData::Member>& rMembers, sal_uInt16 nEmptyPos = LISTBOX_APPEND ) { bool bEmpty = false; vector<ScDPLabelData::Member>::const_iterator itr = rMembers.begin(), itrEnd = rMembers.end(); @@ -110,7 +110,7 @@ bool lclFillListBox( ListBoxType& rLBox, const vector<ScDPLabelData::Member>& rM } /** This table represents the order of the strings in the resource string array. */ -static const USHORT spnFunctions[] = +static const sal_uInt16 spnFunctions[] = { PIVOT_FUNC_SUM, PIVOT_FUNC_COUNT, @@ -125,12 +125,12 @@ static const USHORT spnFunctions[] = PIVOT_FUNC_STD_VARP }; -const USHORT SC_BASEITEM_PREV_POS = 0; -const USHORT SC_BASEITEM_NEXT_POS = 1; -const USHORT SC_BASEITEM_USER_POS = 2; +const sal_uInt16 SC_BASEITEM_PREV_POS = 0; +const sal_uInt16 SC_BASEITEM_NEXT_POS = 1; +const sal_uInt16 SC_BASEITEM_USER_POS = 2; -const USHORT SC_SORTNAME_POS = 0; -const USHORT SC_SORTDATA_POS = 1; +const sal_uInt16 SC_SORTNAME_POS = 0; +const sal_uInt16 SC_SORTDATA_POS = 1; const long SC_SHOW_DEFAULT = 10; @@ -173,19 +173,19 @@ ScDPFunctionListBox::ScDPFunctionListBox( Window* pParent, const ResId& rResId ) FillFunctionNames(); } -void ScDPFunctionListBox::SetSelection( USHORT nFuncMask ) +void ScDPFunctionListBox::SetSelection( sal_uInt16 nFuncMask ) { if( (nFuncMask == PIVOT_FUNC_NONE) || (nFuncMask == PIVOT_FUNC_AUTO) ) SetNoSelection(); else - for( USHORT nEntry = 0, nCount = GetEntryCount(); nEntry < nCount; ++nEntry ) + for( sal_uInt16 nEntry = 0, nCount = GetEntryCount(); nEntry < nCount; ++nEntry ) SelectEntryPos( nEntry, (nFuncMask & spnFunctions[ nEntry ]) != 0 ); } -USHORT ScDPFunctionListBox::GetSelection() const +sal_uInt16 ScDPFunctionListBox::GetSelection() const { - USHORT nFuncMask = PIVOT_FUNC_NONE; - for( USHORT nSel = 0, nCount = GetSelectEntryCount(); nSel < nCount; ++nSel ) + sal_uInt16 nFuncMask = PIVOT_FUNC_NONE; + for( sal_uInt16 nSel = 0, nCount = GetSelectEntryCount(); nSel < nCount; ++nSel ) nFuncMask |= spnFunctions[ GetSelectEntryPos( nSel ) ]; return nFuncMask; } @@ -195,15 +195,15 @@ void ScDPFunctionListBox::FillFunctionNames() DBG_ASSERT( !GetEntryCount(), "ScDPFunctionListBox::FillFunctionNames - do not add texts to resource" ); Clear(); ResStringArray aArr( ScResId( SCSTR_DPFUNCLISTBOX ) ); - for( USHORT nIndex = 0, nCount = sal::static_int_cast<USHORT>(aArr.Count()); nIndex < nCount; ++nIndex ) + for( sal_uInt16 nIndex = 0, nCount = sal::static_int_cast<sal_uInt16>(aArr.Count()); nIndex < nCount; ++nIndex ) InsertEntry( aArr.GetString( nIndex ) ); } // ============================================================================ ScDPFunctionDlg::ScDPFunctionDlg( - Window* pParent, const ScDPLabelDataVec& rLabelVec, - const ScDPLabelData& rLabelData, const ScDPFuncData& rFuncData ) : + Window* pParent, const ScDPLabelDataVector& rLabelVec, + const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData ) : ModalDialog ( pParent, ScResId( RID_SCDLG_DPDATAFIELD ) ), maFlFunc ( this, ScResId( FL_FUNC ) ), maLbFunc ( this, ScResId( LB_FUNC ) ), @@ -228,7 +228,7 @@ ScDPFunctionDlg::ScDPFunctionDlg( Init( rLabelData, rFuncData ); } -USHORT ScDPFunctionDlg::GetFuncMask() const +sal_uInt16 ScDPFunctionDlg::GetFuncMask() const { return maLbFunc.GetSelection(); } @@ -240,7 +240,7 @@ DataPilotFieldReference ScDPFunctionDlg::GetFieldRef() const aRef.ReferenceType = maLbTypeWrp.GetControlValue(); aRef.ReferenceField = GetBaseFieldName(maLbBaseField.GetSelectEntry()); - USHORT nBaseItemPos = maLbBaseItem.GetSelectEntryPos(); + sal_uInt16 nBaseItemPos = maLbBaseItem.GetSelectEntryPos(); switch( nBaseItemPos ) { case SC_BASEITEM_PREV_POS: @@ -260,10 +260,10 @@ DataPilotFieldReference ScDPFunctionDlg::GetFieldRef() const return aRef; } -void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScDPFuncData& rFuncData ) +void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData ) { // list box - USHORT nFuncMask = (rFuncData.mnFuncMask == PIVOT_FUNC_NONE) ? PIVOT_FUNC_SUM : rFuncData.mnFuncMask; + sal_uInt16 nFuncMask = (rFuncData.mnFuncMask == PIVOT_FUNC_NONE) ? PIVOT_FUNC_SUM : rFuncData.mnFuncMask; maLbFunc.SetSelection( nFuncMask ); // field name @@ -325,8 +325,8 @@ void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScDPFuncData& } else { - USHORT nStartPos = mbEmptyItem ? (SC_BASEITEM_USER_POS + 1) : SC_BASEITEM_USER_POS; - USHORT nPos = FindBaseItemPos( rFuncData.maFieldRef.ReferenceItemName, nStartPos ); + sal_uInt16 nStartPos = mbEmptyItem ? (SC_BASEITEM_USER_POS + 1) : SC_BASEITEM_USER_POS; + sal_uInt16 nPos = FindBaseItemPos( rFuncData.maFieldRef.ReferenceItemName, nStartPos ); if( nPos >= maLbBaseItem.GetEntryCount() ) nPos = (maLbBaseItem.GetEntryCount() > SC_BASEITEM_USER_POS) ? SC_BASEITEM_USER_POS : SC_BASEITEM_PREV_POS; maLbBaseItem.SelectEntryPos( nPos ); @@ -347,7 +347,7 @@ const OUString& ScDPFunctionDlg::GetBaseItemName(const OUString& rLayoutName) co return itr == maBaseItemNameMap.end() ? rLayoutName : itr->second; } -sal_uInt16 ScDPFunctionDlg::FindBaseItemPos( const String& rEntry, USHORT nStartPos ) const +sal_uInt16 ScDPFunctionDlg::FindBaseItemPos( const String& rEntry, sal_uInt16 nStartPos ) const { sal_uInt16 nPos = nStartPos; bool bFound = false; @@ -417,7 +417,7 @@ IMPL_LINK( ScDPFunctionDlg, SelectHdl, ListBox*, pLBox ) } // select base item - USHORT nItemPos = (maLbBaseItem.GetEntryCount() > SC_BASEITEM_USER_POS) ? SC_BASEITEM_USER_POS : SC_BASEITEM_PREV_POS; + sal_uInt16 nItemPos = (maLbBaseItem.GetEntryCount() > SC_BASEITEM_USER_POS) ? SC_BASEITEM_USER_POS : SC_BASEITEM_PREV_POS; maLbBaseItem.SelectEntryPos( nItemPos ); } return 0; @@ -432,7 +432,7 @@ IMPL_LINK( ScDPFunctionDlg, DblClickHdl, MultiListBox*, EMPTYARG ) // ============================================================================ ScDPSubtotalDlg::ScDPSubtotalDlg( Window* pParent, ScDPObject& rDPObj, - const ScDPLabelData& rLabelData, const ScDPFuncData& rFuncData, + const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData, const ScDPNameVec& rDataFields, bool bEnableLayout ) : ModalDialog ( pParent, ScResId( RID_SCDLG_PIVOTSUBT ) ), maFlSubt ( this, ScResId( FL_FUNC ) ), @@ -456,9 +456,9 @@ ScDPSubtotalDlg::ScDPSubtotalDlg( Window* pParent, ScDPObject& rDPObj, Init( rLabelData, rFuncData ); } -USHORT ScDPSubtotalDlg::GetFuncMask() const +sal_uInt16 ScDPSubtotalDlg::GetFuncMask() const { - USHORT nFuncMask = PIVOT_FUNC_NONE; + sal_uInt16 nFuncMask = PIVOT_FUNC_NONE; if( maRbAuto.IsChecked() ) nFuncMask = PIVOT_FUNC_AUTO; @@ -479,7 +479,7 @@ void ScDPSubtotalDlg::FillLabelData( ScDPLabelData& rLabelData ) const rLabelData.maShowInfo = maLabelData.maShowInfo; } -void ScDPSubtotalDlg::Init( const ScDPLabelData& rLabelData, const ScDPFuncData& rFuncData ) +void ScDPSubtotalDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData ) { // field name maFtName.SetText(rLabelData.getDisplayName()); @@ -604,8 +604,8 @@ void ScDPSubtotalOptDlg::FillLabelData( ScDPLabelData& rLabelData ) const // *** HIDDEN ITEMS *** rLabelData.maMembers = maLabelData.maMembers; - ULONG nVisCount = maLbHide.GetEntryCount(); - for( USHORT nPos = 0; nPos < nVisCount; ++nPos ) + sal_uLong nVisCount = maLbHide.GetEntryCount(); + for( sal_uInt16 nPos = 0; nPos < nVisCount; ++nPos ) rLabelData.maMembers[nPos].mbVisible = !maLbHide.IsChecked(nPos); // *** HIERARCHY *** @@ -634,7 +634,7 @@ void ScDPSubtotalOptDlg::Init( const ScDPNameVec& rDataFields, bool bEnableLayou if( maLbSortBy.GetEntryCount() > SC_SORTDATA_POS ) maLbSortBy.SetSeparatorPos( SC_SORTDATA_POS - 1 ); - USHORT nSortPos = SC_SORTNAME_POS; + sal_uInt16 nSortPos = SC_SORTNAME_POS; if( nSortMode == DataPilotFieldSortMode::DATA ) { nSortPos = FindListBoxEntry( maLbSortBy, maLabelData.maSortInfo.Field, SC_SORTDATA_POS ); @@ -704,7 +704,7 @@ void ScDPSubtotalOptDlg::Init( const ScDPNameVec& rDataFields, bool bEnableLayou lclFillListBox( maLbHierarchy, maLabelData.maHiers ); sal_Int32 nHier = maLabelData.mnUsedHier; if( (nHier < 0) || (nHier >= maLabelData.maHiers.getLength()) ) nHier = 0; - maLbHierarchy.SelectEntryPos( static_cast< USHORT >( nHier ) ); + maLbHierarchy.SelectEntryPos( static_cast< sal_uInt16 >( nHier ) ); maLbHierarchy.SetSelectHdl( LINK( this, ScDPSubtotalOptDlg, SelectHdl ) ); } else @@ -720,7 +720,7 @@ void ScDPSubtotalOptDlg::InitHideListBox() lclFillListBox( maLbHide, maLabelData.maMembers ); size_t n = maLabelData.maMembers.size(); for (size_t i = 0; i < n; ++i) - maLbHide.CheckEntryPos(static_cast<USHORT>(i), !maLabelData.maMembers[i].mbVisible); + maLbHide.CheckEntryPos(static_cast<sal_uInt16>(i), !maLabelData.maMembers[i].mbVisible); bool bEnable = maLbHide.GetEntryCount() > 0; maFlHide.Enable( bEnable ); maLbHide.Enable( bEnable ); @@ -733,7 +733,7 @@ const OUString& ScDPSubtotalOptDlg::GetFieldName(const OUString& rLayoutName) co } sal_uInt16 ScDPSubtotalOptDlg::FindListBoxEntry( - const ListBox& rLBox, const String& rEntry, USHORT nStartPos ) const + const ListBox& rLBox, const String& rEntry, sal_uInt16 nStartPos ) const { sal_uInt16 nPos = nStartPos; bool bFound = false; @@ -786,7 +786,7 @@ IMPL_LINK( ScDPSubtotalOptDlg, SelectHdl, ListBox*, pLBox ) // ============================================================================ -ScDPShowDetailDlg::ScDPShowDetailDlg( Window* pParent, ScDPObject& rDPObj, USHORT nOrient ) : +ScDPShowDetailDlg::ScDPShowDetailDlg( Window* pParent, ScDPObject& rDPObj, sal_uInt16 nOrient ) : ModalDialog ( pParent, ScResId( RID_SCDLG_DPSHOWDETAIL ) ), maFtDims ( this, ScResId( FT_DIMS ) ), maLbDims ( this, ScResId( LB_DIMS ) ), @@ -802,7 +802,7 @@ ScDPShowDetailDlg::ScDPShowDetailDlg( Window* pParent, ScDPObject& rDPObj, USHOR long nDimCount = rDPObj.GetDimCount(); for (long nDim=0; nDim<nDimCount; nDim++) { - BOOL bIsDataLayout; + sal_Bool bIsDataLayout; sal_Int32 nDimFlags = 0; String aName = rDPObj.GetDimName( nDim, bIsDataLayout, &nDimFlags ); if ( !bIsDataLayout && !rDPObj.IsDuplicated( nDim ) && ScDPObject::IsOrientationAllowed( nOrient, nDimFlags ) ) @@ -843,7 +843,7 @@ String ScDPShowDetailDlg::GetDimensionName() const return aSelectedName; long nDim = itr->second; - BOOL bIsDataLayout = false; + sal_Bool bIsDataLayout = false; return mrDPObj.GetDimName(nDim, bIsDataLayout); } diff --git a/sc/source/ui/dbgui/pvfundlg.src b/sc/source/ui/dbgui/pvfundlg.src index ed00f6a65fa5..d5203f2a89ac 100644 --- a/sc/source/ui/dbgui/pvfundlg.src +++ b/sc/source/ui/dbgui/pvfundlg.src @@ -64,6 +64,7 @@ ModalDialog RID_SCDLG_DPDATAFIELD }; MultiListBox LB_FUNC { + HelpID = "sc:MultiListBox:RID_SCDLG_DPDATAFIELD:LB_FUNC"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 140 , 65 ) ; @@ -96,6 +97,7 @@ ModalDialog RID_SCDLG_DPDATAFIELD }; ListBox LB_TYPE { + HelpID = "sc:ListBox:RID_SCDLG_DPDATAFIELD:LB_TYPE"; Pos = MAP_APPFONT( 75, 110 ); Size = MAP_APPFONT( 77, 120 ); TabStop = TRUE; @@ -122,6 +124,7 @@ ModalDialog RID_SCDLG_DPDATAFIELD }; ListBox LB_BASEFIELD { + HelpID = "sc:ListBox:RID_SCDLG_DPDATAFIELD:LB_BASEFIELD"; Pos = MAP_APPFONT( 75, 126 ); Size = MAP_APPFONT( 77, 120 ); TabStop = TRUE; @@ -136,6 +139,7 @@ ModalDialog RID_SCDLG_DPDATAFIELD }; ListBox LB_BASEITEM { + HelpID = "sc:ListBox:RID_SCDLG_DPDATAFIELD:LB_BASEITEM"; Pos = MAP_APPFONT( 75, 142 ); Size = MAP_APPFONT( 77, 120 ); TabStop = TRUE; @@ -168,6 +172,7 @@ ModalDialog RID_SCDLG_DPDATAFIELD }; MoreButton BTN_MORE { + HelpID = "sc:MoreButton:RID_SCDLG_DPDATAFIELD:BTN_MORE"; Pos = MAP_APPFONT ( 164 , 79 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -191,6 +196,7 @@ ModalDialog RID_SCDLG_PIVOTSUBT Hide = TRUE ; RadioButton RB_NONE { + HelpID = "sc:RadioButton:RID_SCDLG_PIVOTSUBT:RB_NONE"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 140 , 10 ) ; Text [ en-US ] = "~None" ; @@ -198,6 +204,7 @@ ModalDialog RID_SCDLG_PIVOTSUBT }; RadioButton RB_AUTO { + HelpID = "sc:RadioButton:RID_SCDLG_PIVOTSUBT:RB_AUTO"; Pos = MAP_APPFONT ( 12 , 28 ) ; Size = MAP_APPFONT ( 140 , 10 ) ; Text [ en-US ] = "~Automatic" ; @@ -205,6 +212,7 @@ ModalDialog RID_SCDLG_PIVOTSUBT }; RadioButton RB_USER { + HelpID = "sc:RadioButton:RID_SCDLG_PIVOTSUBT:RB_USER"; Pos = MAP_APPFONT ( 12 , 42 ) ; Size = MAP_APPFONT ( 140 , 10 ) ; Text [ en-US ] = "~User-defined" ; @@ -212,6 +220,7 @@ ModalDialog RID_SCDLG_PIVOTSUBT }; MultiListBox LB_FUNC { + HelpID = "sc:MultiListBox:RID_SCDLG_PIVOTSUBT:LB_FUNC"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 56 ) ; Size = MAP_APPFONT ( 140 , 65 ) ; @@ -227,6 +236,7 @@ ModalDialog RID_SCDLG_PIVOTSUBT }; CheckBox CB_SHOWALL { + HelpID = "sc:CheckBox:RID_SCDLG_PIVOTSUBT:CB_SHOWALL"; Pos = MAP_APPFONT ( 6 , 127 ) ; Size = MAP_APPFONT ( 152 , 10 ) ; Text [ en-US ] = "Show it~ems without data"; @@ -264,6 +274,7 @@ ModalDialog RID_SCDLG_PIVOTSUBT }; PushButton BTN_OPTIONS { + HelpID = "sc:PushButton:RID_SCDLG_PIVOTSUBT:BTN_OPTIONS"; Pos = MAP_APPFONT ( 164 , 135 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -290,6 +301,7 @@ ModalDialog RID_SCDLG_DPSUBTOTAL_OPT }; ListBox LB_SORT_BY { + HelpID = "sc:ListBox:RID_SCDLG_DPSUBTOTAL_OPT:LB_SORT_BY"; Pos = MAP_APPFONT( 12, 26 ); Size = MAP_APPFONT( 96, 120 ); TabStop = TRUE; @@ -298,6 +310,7 @@ ModalDialog RID_SCDLG_DPSUBTOTAL_OPT }; RadioButton RB_SORT_ASC { + HelpID = "sc:RadioButton:RID_SCDLG_DPSUBTOTAL_OPT:RB_SORT_ASC"; Pos = MAP_APPFONT( 114, 14 ); Size = MAP_APPFONT( 84, 10 ); TabStop = TRUE; @@ -305,6 +318,7 @@ ModalDialog RID_SCDLG_DPSUBTOTAL_OPT }; RadioButton RB_SORT_DESC { + HelpID = "sc:RadioButton:RID_SCDLG_DPSUBTOTAL_OPT:RB_SORT_DESC"; Pos = MAP_APPFONT( 114, 28 ); Size = MAP_APPFONT( 84, 10 ); TabStop = TRUE; @@ -312,6 +326,7 @@ ModalDialog RID_SCDLG_DPSUBTOTAL_OPT }; RadioButton RB_SORT_MAN { + HelpID = "sc:RadioButton:RID_SCDLG_DPSUBTOTAL_OPT:RB_SORT_MAN"; Pos = MAP_APPFONT( 114, 42 ); Size = MAP_APPFONT( 84, 10 ); TabStop = TRUE; @@ -331,6 +346,7 @@ ModalDialog RID_SCDLG_DPSUBTOTAL_OPT }; ListBox LB_LAYOUT { + HelpID = "sc:ListBox:RID_SCDLG_DPSUBTOTAL_OPT:LB_LAYOUT"; Pos = MAP_APPFONT( 84, 67 ); Size = MAP_APPFONT( 114, 120 ); TabStop = TRUE; @@ -345,6 +361,7 @@ ModalDialog RID_SCDLG_DPSUBTOTAL_OPT }; CheckBox CB_LAYOUT_EMPTY { + HelpID = "sc:CheckBox:RID_SCDLG_DPSUBTOTAL_OPT:CB_LAYOUT_EMPTY"; Pos = MAP_APPFONT( 12, 85 ); Size = MAP_APPFONT( 186, 10 ); TabStop = TRUE; @@ -358,6 +375,7 @@ ModalDialog RID_SCDLG_DPSUBTOTAL_OPT }; CheckBox CB_SHOW { + HelpID = "sc:CheckBox:RID_SCDLG_DPSUBTOTAL_OPT:CB_SHOW"; Pos = MAP_APPFONT( 12, 112 ); Size = MAP_APPFONT( 70, 10 ); TabStop = TRUE; @@ -365,6 +383,7 @@ ModalDialog RID_SCDLG_DPSUBTOTAL_OPT }; NumericField NF_SHOW { + HelpID = "sc:NumericField:RID_SCDLG_DPSUBTOTAL_OPT:NF_SHOW"; Pos = MAP_APPFONT( 84, 110 ); Size = MAP_APPFONT( 30, 12 ); TabStop = TRUE; @@ -390,6 +409,7 @@ ModalDialog RID_SCDLG_DPSUBTOTAL_OPT }; ListBox LB_SHOW_FROM { + HelpID = "sc:ListBox:RID_SCDLG_DPSUBTOTAL_OPT:LB_SHOW_FROM"; Pos = MAP_APPFONT( 84, 126 ); Size = MAP_APPFONT( 114, 50 ); TabStop = TRUE; @@ -409,6 +429,7 @@ ModalDialog RID_SCDLG_DPSUBTOTAL_OPT }; ListBox LB_SHOW_USING { + HelpID = "sc:ListBox:RID_SCDLG_DPSUBTOTAL_OPT:LB_SHOW_USING"; Pos = MAP_APPFONT( 84, 142 ); Size = MAP_APPFONT( 114, 120 ); TabStop = TRUE; @@ -436,6 +457,7 @@ ModalDialog RID_SCDLG_DPSUBTOTAL_OPT }; ListBox LB_HIERARCHY { + HelpID = "sc:ListBox:RID_SCDLG_DPSUBTOTAL_OPT:LB_HIERARCHY"; Pos = MAP_APPFONT( 84, 222 ); Size = MAP_APPFONT( 114, 120 ); TabStop = TRUE; @@ -483,6 +505,7 @@ ModalDialog RID_SCDLG_DPSHOWDETAIL }; ListBox LB_DIMS { + HelpID = "sc:ListBox:RID_SCDLG_DPSHOWDETAIL:LB_DIMS"; Pos = MAP_APPFONT( 6, 30 ); Size = MAP_APPFONT( 132, 80 ); TabStop = TRUE; diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx index 71ba04990861..e805ecff55db 100644 --- a/sc/source/ui/dbgui/pvlaydlg.cxx +++ b/sc/source/ui/dbgui/pvlaydlg.cxx @@ -41,6 +41,11 @@ #include <com/sun/star/sheet/DataPilotFieldOrientation.hpp> #include <com/sun/star/sheet/DataPilotFieldSortMode.hpp> +#include <sfx2/dispatch.hxx> +#include <vcl/mnemonic.hxx> +#include <vcl/msgbox.hxx> + +#include "dbdocfun.hxx" #include "uiitems.hxx" #include "rangeutl.hxx" #include "document.hxx" @@ -75,15 +80,7 @@ namespace { PointerStyle lclGetPointerForField( ScDPFieldType eType ) { - switch( eType ) - { - case TYPE_PAGE: return POINTER_PIVOT_FIELD; - case TYPE_COL: return POINTER_PIVOT_COL; - case TYPE_ROW: return POINTER_PIVOT_ROW; - case TYPE_DATA: return POINTER_PIVOT_FIELD; - case TYPE_SELECT: return POINTER_PIVOT_FIELD; - } - return POINTER_ARROW; + return MnemonicGenerator::EraseAllMnemonicChars( rFixedText.GetText() ); } } // namespace @@ -134,7 +131,7 @@ ScDPLayoutDlg::ScDPLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pPar aStrUndefined ( ScResId( SCSTR_UNDEFINED ) ), aStrNewTable ( ScResId( SCSTR_NEWTABLE ) ), - bIsDrag ( FALSE ), + bIsDrag ( false ), pEditActive ( NULL ), @@ -148,8 +145,8 @@ ScDPLayoutDlg::ScDPLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pPar GetViewData()->GetDocument() ), bRefInputMode (false) { - xDlgDPObject->SetAlive( TRUE ); // needed to get structure information - xDlgDPObject->FillOldParam( thePivotData, FALSE ); + xDlgDPObject->SetAlive( true ); // needed to get structure information + xDlgDPObject->FillOldParam( thePivotData, false ); xDlgDPObject->FillLabelData( thePivotData ); Init(bNewOutput); @@ -160,8 +157,8 @@ ScDPLayoutDlg::ScDPLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pPar ScDPLayoutDlg::~ScDPLayoutDlg() { - USHORT nEntries = aLbOutPos.GetEntryCount(); - USHORT i; + sal_uInt16 nEntries = aLbOutPos.GetEntryCount(); + sal_uInt16 i; for ( i=2; i<nEntries; i++ ) delete (String*)aLbOutPos.GetEntryData( i ); @@ -178,7 +175,7 @@ void ScDPLayoutDlg::Init(bool bNewOutput) aBtnOptions.SetClickHdl( LINK( this, ScDPLayoutDlg, ClickHdl ) ); aFuncNameArr.reserve( PIVOT_MAXFUNC ); - for ( USHORT i = 0; i < PIVOT_MAXFUNC; ++i ) + for ( sal_uInt16 i = 0; i < PIVOT_MAXFUNC; ++i ) aFuncNameArr.push_back( String( ScResId( i + 1 ) ) ); aBtnMore.AddWindow( &aFlAreas ); @@ -218,12 +215,17 @@ void ScDPLayoutDlg::Init(bool bNewOutput) } else { - /* Data is not reachable, so could be a remote database */ - aEdInPos.Disable(); - aRbInPos.Disable(); + // data is not reachable, so could be a remote database + maEdInPos.Disable(); + maRbInPos.Disable(); } - InitFields(); + // #i29203# align right border of page window with data window + long nPagePosX = maWndData.GetPosPixel().X() + maWndData.GetSizePixel().Width() - maWndPage.GetSizePixel().Width(); + maWndPage.SetPosPixel( Point( nPagePosX, maWndPage.GetPosPixel().Y() ) ); + maScrPage.SetPosPixel( Point( maScrData.GetPosPixel().X(), maScrPage.GetPosPixel().Y() ) ); + + InitFieldWindows(); aLbOutPos .SetSelectHdl( LINK( this, ScDPLayoutDlg, SelAreaHdl ) ); aEdOutPos .SetModifyHdl( LINK( this, ScDPLayoutDlg, EdModifyHdl ) ); @@ -236,7 +238,7 @@ void ScDPLayoutDlg::Init(bool bNewOutput) aEdInPos.SetGetFocusHdl( aLink ); aEdOutPos.SetGetFocusHdl( aLink ); - if ( pViewData && pDoc ) + if( mpViewData && mpDoc ) { /* * Aus den RangeNames des Dokumentes werden nun die @@ -244,11 +246,11 @@ void ScDPLayoutDlg::Init(bool bNewOutput) * um sinnvolle Bereiche handelt */ - aLbOutPos.Clear(); - aLbOutPos.InsertEntry( aStrUndefined, 0 ); - aLbOutPos.InsertEntry( aStrNewTable, 1 ); + maLbOutPos.Clear(); + maLbOutPos.InsertEntry( String( ScResId( SCSTR_UNDEFINED ) ), 0 ); + maLbOutPos.InsertEntry( String( ScResId( SCSTR_NEWTABLE ) ), 1 ); - ScAreaNameIterator aIter( pDoc ); + ScAreaNameIterator aIter( mpDoc ); String aName; ScRange aRange; String aRefStr; @@ -256,10 +258,10 @@ void ScDPLayoutDlg::Init(bool bNewOutput) { if ( !aIter.WasDBName() ) // hier keine DB-Bereiche ! { - USHORT nInsert = aLbOutPos.InsertEntry( aName ); + sal_uInt16 nInsert = maLbOutPos.InsertEntry( aName ); - aRange.aStart.Format( aRefStr, SCA_ABS_3D, pDoc, pDoc->GetAddressConvention() ); - aLbOutPos.SetEntryData( nInsert, new String( aRefStr ) ); + aRange.aStart.Format( aRefStr, SCA_ABS_3D, mpDoc, mpDoc->GetAddressConvention() ); + maLbOutPos.SetEntryData( nInsert, new String( aRefStr ) ); } } } @@ -318,14 +320,12 @@ void ScDPLayoutDlg::Init(bool bNewOutput) //---------------------------------------------------------------------------- -BOOL ScDPLayoutDlg::Close() +sal_Bool ScDPLayoutDlg::Close() { return DoClose( ScPivotLayoutWrapper::GetChildWindowId() ); } -//---------------------------------------------------------------------------- - -void ScDPLayoutDlg::StateChanged( StateChangedType nStateChange ) +ScPivotLayoutDlg::~ScPivotLayoutDlg() { ScAnyRefDlg::StateChanged( nStateChange ); @@ -344,9 +344,7 @@ void ScDPLayoutDlg::StateChanged( StateChangedType nStateChange ) } } -//---------------------------------------------------------------------------- - -void ScDPLayoutDlg::InitWndSelect( const vector<ScDPLabelDataRef>& rLabels ) +ScDPLabelData* ScPivotLayoutDlg::GetLabelData( SCCOL nCol, size_t* pnIndex ) { size_t nLabelCount = rLabels.size(); if (nLabelCount > MAX_LABELS) @@ -379,7 +377,7 @@ void ScDPLayoutDlg::InitFieldWindow( const vector<PivotField>& rFields, ScDPFiel for (; itr != itrEnd; ++itr) { SCCOL nCol = itr->nCol; - USHORT nMask = itr->nFuncMask; + sal_uInt16 nMask = itr->nFuncMask; if (nCol == PIVOT_DATA_FIELD) continue; @@ -397,7 +395,7 @@ void ScDPLayoutDlg::InitFieldWindow( const vector<PivotField>& rFields, ScDPFiel OUString aStr = pData->maLayoutName; if (!aStr.getLength()) { - USHORT nInitMask = pInitArr->back()->mnFuncMask; + sal_uInt16 nInitMask = pInitArr->back()->mnFuncMask; aStr = GetFuncString(nInitMask, pData->mbIsValue); aStr += pData->maName; } @@ -414,18 +412,16 @@ void ScDPLayoutDlg::InitFieldWindow( const vector<PivotField>& rFields, ScDPFiel //---------------------------------------------------------------------------- -void ScDPLayoutDlg::InitFocus() +void ScPivotLayoutDlg::NotifyStartTracking( ScPivotFieldWindow& rSourceWindow ) { - if( aWndSelect.IsEmpty() ) - { - aBtnOk.GrabFocus(); - NotifyFieldFocus( TYPE_SELECT, FALSE ); - } - else - aWndSelect.GrabFocus(); + mpTrackingWindow = &rSourceWindow; + mpDropWindow = 0; + rSourceWindow.NotifyStartTracking(); + StartTracking( STARTTRACK_BUTTONREPEAT ); + SetPointer( Pointer( rSourceWindow.GetDropPointerStyle() ) ); } -void ScDPLayoutDlg::InitFields() +void ScPivotLayoutDlg::NotifyDoubleClick( ScPivotFieldWindow& rSourceWindow ) { InitWndSelect(thePivotData.maLabelArray); InitFieldWindow(thePivotData.maPageFields, TYPE_PAGE); @@ -434,7 +430,10 @@ void ScDPLayoutDlg::InitFields() InitFieldWindow(thePivotData.maDataFields, TYPE_DATA); } -//---------------------------------------------------------------------------- + ScDPLabelData* pLabelData = GetLabelData( pFuncData->mnCol ); + DBG_ASSERT( pLabelData, "ScPivotLayoutDlg::NotifyDoubleClick - missing label data" ); + if( !pLabelData ) + return; void ScDPLayoutDlg::AddField( size_t nFromIndex, ScDPFieldType eToType, const Point& rAtPos ) { @@ -455,42 +454,19 @@ void ScDPLayoutDlg::AddField( size_t nFromIndex, ScDPFieldType eToType, const Po bool bAllowed = IsOrientationAllowed( fData.mnCol, eToType ); if ( bAllowed && (!Contains( toArr, fData.mnCol, nAt )) ) { - // ggF. in anderem Fenster entfernen - if ( rmArr1 ) - { - if ( Contains( rmArr1, fData.mnCol, nAt ) ) - { - rmWnd1->DelField( nAt ); - Remove( rmArr1, nAt ); - } - } - if ( rmArr2 ) - { - if ( Contains( rmArr2, fData.mnCol, nAt ) ) - { - rmWnd2->DelField( nAt ); - Remove( rmArr2, nAt ); - } - } - - ScDPLabelData& rData = aLabelDataArr[nFromIndex+nOffset]; - size_t nAddedAt = 0; - - if ( !bDataArr ) - { - if ( toWnd->AddField( rData.getDisplayName(), - DlgPos2WndPos( rAtPos, *toWnd ), - nAddedAt ) ) - { - Insert( toArr, fData, nAddedAt ); - toWnd->GrabFocus(); - } - } - else + // list of plain names of all data fields + ScDPNameVec aDataFieldNames; + maWndData.WriteFieldNames( aDataFieldNames ); + // allow to modify layout options for row fields, if multiple data fields exist, or if it is not the last row field + bool bLayout = (rSourceWindow.GetType() == PIVOTFIELDTYPE_ROW) && ((aDataFieldNames.size() > 1) || (rSourceWindow.GetSelectedIndex() + 1 < rSourceWindow.GetFieldCount())); + + ::std::auto_ptr< AbstractScDPSubtotalDlg > xDlg( pFactory->CreateScDPSubtotalDlg( + this, RID_SCDLG_PIVOTSUBT, *mxDlgDPObject, *pLabelData, *pFuncData, aDataFieldNames, bLayout ) ); + if( xDlg->Execute() == RET_OK ) { ScDPLabelData* p = GetLabelData(fData.mnCol); OUString aStr = p->maLayoutName; - USHORT nMask = fData.mnFuncMask; + sal_uInt16 nMask = fData.mnFuncMask; if (!aStr.getLength()) { aStr = GetFuncString(nMask); @@ -506,7 +482,6 @@ void ScDPLayoutDlg::AddField( size_t nFromIndex, ScDPFieldType eToType, const Po toWnd->GrabFocus(); } } - } } @@ -562,7 +537,7 @@ void ScDPLayoutDlg::AppendField(size_t nFromIndex, ScDPFieldType eToType) { ScDPLabelData* p = GetLabelData(aFuncData.mnCol); OUString aStr = p->maLayoutName; - USHORT nMask = aFuncData.mnFuncMask; + sal_uInt16 nMask = aFuncData.mnFuncMask; if (!aStr.getLength()) { aStr = GetFuncString(nMask); @@ -649,7 +624,7 @@ void ScDPLayoutDlg::MoveField( ScDPFieldType eFromType, size_t nFromIndex, ScDPF { ScDPLabelData* p = GetLabelData(fData.mnCol); OUString aStr = p->maLayoutName; - USHORT nMask = fData.mnFuncMask; + sal_uInt16 nMask = fData.mnFuncMask; if (!aStr.getLength()) { aStr = GetFuncString(nMask); @@ -669,13 +644,17 @@ void ScDPLayoutDlg::MoveField( ScDPFieldType eFromType, size_t nFromIndex, ScDPF } } } - else // -> eFromType == eToType + if( mpDropWindow ) + mpDropWindow->NotifyTracking( rDialogPos - pTargetWindow->GetPosPixel() ); + + // end tracking: move or remove field + if( rTEvt.IsTrackingEnded() ) { ScDPFieldControlBase* theWnd = GetFieldWindow(eFromType); ScDPFuncDataVec* theArr = GetFieldDataArray(eFromType); size_t nAt = 0; Point aToPos; - BOOL bDataArr = eFromType == TYPE_DATA; + sal_Bool bDataArr = eFromType == TYPE_DATA; ScDPFuncData fData( *((*theArr)[nFromIndex]) ); @@ -705,7 +684,7 @@ void ScDPLayoutDlg::MoveField( ScDPFieldType eFromType, size_t nFromIndex, ScDPF { ScDPLabelData* p = GetLabelData(fData.mnCol); OUString aStr = p->maLayoutName; - USHORT nMask = fData.mnFuncMask; + sal_uInt16 nMask = fData.mnFuncMask; if (!aStr.getLength()) { aStr = GetFuncString(nMask); @@ -790,7 +769,7 @@ void ScDPLayoutDlg::MoveFieldToEnd( ScDPFieldType eFromType, size_t nFromIndex, { ScDPLabelData* p = GetLabelData(fData.mnCol); OUString aStr = p->maLayoutName; - USHORT nMask = fData.mnFuncMask; + sal_uInt16 nMask = fData.mnFuncMask; if (!aStr.getLength()) { aStr = GetFuncString(nMask); @@ -814,7 +793,7 @@ void ScDPLayoutDlg::MoveFieldToEnd( ScDPFieldType eFromType, size_t nFromIndex, ScDPFuncDataVec* theArr = GetFieldDataArray(eFromType); size_t nAt = 0; Point aToPos; - BOOL bDataArr = eFromType == TYPE_DATA; + sal_Bool bDataArr = eFromType == TYPE_DATA; ScDPFuncData fData( *((*theArr)[nFromIndex]) ); @@ -841,7 +820,7 @@ void ScDPLayoutDlg::MoveFieldToEnd( ScDPFieldType eFromType, size_t nFromIndex, { ScDPLabelData* p = GetLabelData(fData.mnCol); OUString aStr = p->maLayoutName; - USHORT nMask = fData.mnFuncMask; + sal_uInt16 nMask = fData.mnFuncMask; if (!aStr.getLength()) { aStr = GetFuncString(nMask); @@ -856,12 +835,15 @@ void ScDPLayoutDlg::MoveFieldToEnd( ScDPFieldType eFromType, size_t nFromIndex, } } } + eTargetPointer = POINTER_ARROW; + if( mpTrackingWindow != mpDropWindow ) + mpTrackingWindow->NotifyEndTracking( ENDTRACKING_CANCEL ); + mpTrackingWindow = mpDropWindow = 0; } + SetPointer( eTargetPointer ); } -//---------------------------------------------------------------------------- - -void ScDPLayoutDlg::RemoveField( ScDPFieldType eFromType, size_t nIndex ) +void ScPivotLayoutDlg::SetReference( const ScRange& rRef, ScDocument* pDocP ) { ScDPFuncDataVec* pArr = GetFieldDataArray(eFromType); @@ -877,13 +859,11 @@ void ScDPLayoutDlg::RemoveField( ScDPFieldType eFromType, size_t nIndex ) } } -//---------------------------------------------------------------------------- - -void ScDPLayoutDlg::NotifyMouseButtonUp( const Point& rAt ) +sal_Bool ScPivotLayoutDlg::IsRefInputMode() const { if ( bIsDrag ) { - bIsDrag = FALSE; + bIsDrag = false; ScDPFieldType eDnDToType = TYPE_SELECT; Point aPos = ScreenToOutputPixel( rAt ); @@ -927,59 +907,29 @@ void ScDPLayoutDlg::NotifyMouseButtonUp( const Point& rAt ) PointerStyle ScDPLayoutDlg::NotifyMouseMove( const Point& rAt ) { - PointerStyle ePtr = POINTER_ARROW; - - if ( bIsDrag ) + if( mbRefInputMode ) { - Point aPos = ScreenToOutputPixel( rAt ); - ScDPFieldType eCheckTarget = TYPE_SELECT; + if( mpActiveEdit ) + mpActiveEdit->GrabFocus(); - if ( aRectPage.IsInside( aPos ) ) - eCheckTarget = TYPE_PAGE; - else if ( aRectCol.IsInside( aPos ) ) - eCheckTarget = TYPE_COL; - else if ( aRectRow.IsInside( aPos ) ) - eCheckTarget = TYPE_ROW; - else if ( aRectData.IsInside( aPos ) ) - eCheckTarget = TYPE_DATA; - else if ( eDnDFromType != TYPE_SELECT ) - ePtr = POINTER_PIVOT_DELETE; - else if ( aRectSelect.IsInside( aPos ) ) - ePtr = lclGetPointerForField( TYPE_SELECT ); - else - ePtr = POINTER_NOTALLOWED; - - if ( eCheckTarget != TYPE_SELECT ) - { - // check if the target orientation is allowed for this field - ScDPFuncDataVec* fromArr = NULL; - switch ( eDnDFromType ) - { - case TYPE_PAGE: fromArr = &aPageArr; break; - case TYPE_COL: fromArr = &aColArr; break; - case TYPE_ROW: fromArr = &aRowArr; break; - case TYPE_DATA: fromArr = &aDataArr; break; - case TYPE_SELECT: fromArr = &aSelectArr; break; - } - ScDPFuncData fData( *((*fromArr)[nDnDFromIndex]) ); - if (IsOrientationAllowed( fData.mnCol, eCheckTarget )) - ePtr = lclGetPointerForField( eCheckTarget ); - else - ePtr = POINTER_NOTALLOWED; - } + if( mpActiveEdit == &maEdInPos ) + EdInModifyHdl( 0 ); + else if( mpActiveEdit == &maEdOutPos ) + EdOutModifyHdl( 0 ); + } + else + { + GrabFocus(); } - return ePtr; + RefInputDone(); } //---------------------------------------------------------------------------- PointerStyle ScDPLayoutDlg::NotifyMouseButtonDown( ScDPFieldType eType, size_t nFieldIndex ) { - bIsDrag = TRUE; - eDnDFromType = eType; - nDnDFromIndex = nFieldIndex; - return lclGetPointerForField( eType ); + return DoClose( ScPivotLayoutWrapper::GetChildWindowId() ); } //---------------------------------------------------------------------------- @@ -988,9 +938,14 @@ void ScDPLayoutDlg::NotifyDoubleClick( ScDPFieldType eType, size_t nFieldIndex ) { ScDPFuncDataVec* pArr = GetFieldDataArray(eType); - if ( pArr ) +bool ScPivotLayoutDlg::IsInsertAllowed( const ScPivotFieldWindow& rSourceWindow, const ScPivotFieldWindow& rTargetWindow ) +{ + if( rTargetWindow.GetType() != PIVOTFIELDTYPE_SELECT ) { - if ( nFieldIndex >= pArr->size() ) + const ScPivotFuncData* pSourceData = rSourceWindow.GetSelectedFuncData(); + ScDPLabelData* pLabelData = pSourceData ? GetLabelData( pSourceData->mnCol ) : 0; + DBG_ASSERT( pLabelData, "ScPivotLayoutDlg::IsInsertAllowed - label data not found" ); + if( pLabelData ) { OSL_FAIL("invalid selection"); return; @@ -1024,7 +979,7 @@ void ScDPLayoutDlg::NotifyDoubleClick( ScDPFieldType eType, size_t nFieldIndex ) if (!aLayoutName.getLength()) { // No layout name exists. Use the stock name. - USHORT nMask = (*aIt)->mnFuncMask; + sal_uInt16 nMask = (*aIt)->mnFuncMask; OUString aFuncStr = GetFuncString(nMask); aLayoutName = aFuncStr + pDFData->maName; } @@ -1077,25 +1032,25 @@ void ScDPLayoutDlg::NotifyDoubleClick( ScDPFieldType eType, size_t nFieldIndex ) // added to avoid warnings } } + return ScDPObject::IsOrientationAllowed( static_cast< sal_uInt16 >( eOrient ), pLabelData->mnFlags ); } } + return false; } -//---------------------------------------------------------------------------- - -void ScDPLayoutDlg::NotifyFieldFocus( ScDPFieldType eType, BOOL bGotFocus ) +void ScPivotLayoutDlg::InitFieldWindows() { /* Enable Remove/Options buttons on GetFocus in field window. Enable them also, if dialog is deactivated (click into document). The !IsActive() condition handles the case that a LoseFocus event of a field window would follow the Deactivate event of this dialog. */ - BOOL bEnable = (bGotFocus || !IsActive()) && (eType != TYPE_SELECT); + sal_Bool bEnable = (bGotFocus || !IsActive()) && (eType != TYPE_SELECT); // The TestTool may set the focus into an empty field. // Then the Remove/Options buttons must be disabled. ScDPFieldControlBase* pWnd = GetFieldWindow(eType); if ( bEnable && bGotFocus && pWnd && pWnd->IsEmpty() ) - bEnable = FALSE; + bEnable = false; aBtnRemove.Enable( bEnable ); aBtnOptions.Enable( bEnable ); @@ -1114,22 +1069,14 @@ void ScDPLayoutDlg::NotifyMoveFieldToEnd( ScDPFieldType eToType ) MoveFieldToEnd(eLastActiveType, pWnd->GetSelectedField(), eToType); if( pWnd->IsEmpty() ) - NotifyFieldFocus( eToType, TRUE ); + NotifyFieldFocus( eToType, true ); else pWnd->GrabFocus(); if( eLastActiveType == TYPE_SELECT ) aWndSelect.SelectNext(); } else - InitFocus(); -} - -//---------------------------------------------------------------------------- - -void ScDPLayoutDlg::NotifyRemoveField( ScDPFieldType eType, size_t nFieldIndex ) -{ - if( eType != TYPE_SELECT ) - RemoveField( eType, nFieldIndex ); + rFieldWindow.GrabFocus(); } void ScDPLayoutDlg::Deactivate() @@ -1138,15 +1085,15 @@ void ScDPLayoutDlg::Deactivate() event from field window disables Remove/Options buttons. Re-enable them here by simulating a GetFocus event. Event order of LoseFocus and Deactivate is not important. The last event will enable the buttons in both cases (see NotifyFieldFocus). */ - NotifyFieldFocus( eLastActiveType, TRUE ); + NotifyFieldFocus( eLastActiveType, true ); } //---------------------------------------------------------------------------- -BOOL ScDPLayoutDlg::Contains( ScDPFuncDataVec* pArr, SCsCOL nCol, size_t& nAt ) +bool ScPivotLayoutDlg::MoveField( ScPivotFieldWindow& rSourceWindow, ScPivotFieldWindow& rTargetWindow, size_t nInsertIndex, bool bMoveExisting ) { if (!pArr || pArr->empty()) - return FALSE; + return false; ScDPFuncDataVec::const_iterator itr, itrBeg = pArr->begin(), itrEnd = pArr->end(); for (itr = itrBeg; itr != itrEnd; ++itr) @@ -1187,72 +1134,40 @@ void ScDPLayoutDlg::Insert( ScDPFuncDataVec* pArr, const ScDPFuncData& rFData, s //---------------------------------------------------------------------------- -ScDPLabelData* ScDPLayoutDlg::GetLabelData( SCsCOL nCol, size_t* pnPos ) -{ - ScDPLabelData* pData = 0; - for( ScDPLabelDataVec::iterator aIt = aLabelDataArr.begin(), aEnd = aLabelDataArr.end(); !pData && (aIt != aEnd); ++aIt ) - { - if( aIt->mnCol == nCol ) - { - pData = &*aIt; - if( pnPos ) *pnPos = aIt - aLabelDataArr.begin(); - } + return true; } return pData; } //---------------------------------------------------------------------------- -String ScDPLayoutDlg::GetLabelString( SCsCOL nCol ) -{ - ScDPLabelData* pData = GetLabelData( nCol ); - DBG_ASSERT( pData, "LabelData not found" ); - if (pData) - return pData->getDisplayName(); - return String(); -} - -//---------------------------------------------------------------------------- - -bool ScDPLayoutDlg::IsOrientationAllowed( SCsCOL nCol, ScDPFieldType eType ) -{ - bool bAllowed = true; - ScDPLabelData* pData = GetLabelData( nCol ); - DBG_ASSERT( pData, "LabelData not found" ); - if (pData) - { - sheet::DataPilotFieldOrientation eOrient = sheet::DataPilotFieldOrientation_HIDDEN; - switch (eType) - { - case TYPE_PAGE: eOrient = sheet::DataPilotFieldOrientation_PAGE; break; - case TYPE_COL: eOrient = sheet::DataPilotFieldOrientation_COLUMN; break; - case TYPE_ROW: eOrient = sheet::DataPilotFieldOrientation_ROW; break; - case TYPE_DATA: eOrient = sheet::DataPilotFieldOrientation_DATA; break; - case TYPE_SELECT: eOrient = sheet::DataPilotFieldOrientation_HIDDEN; break; - } - bAllowed = ScDPObject::IsOrientationAllowed( (USHORT)eOrient, pData->mnFlags ); - } - return bAllowed; + return false; } -//---------------------------------------------------------------------------- +// handlers ------------------------------------------------------------------- -String ScDPLayoutDlg::GetFuncString( USHORT& rFuncMask, BOOL bIsValue ) +IMPL_LINK( ScPivotLayoutDlg, ClickHdl, PushButton *, pBtn ) { - String aStr; - - if ( rFuncMask == PIVOT_FUNC_NONE - || rFuncMask == PIVOT_FUNC_AUTO ) + if( mpFocusWindow ) { - if ( bIsValue ) + /* Raising sub dialogs (from the NotifyDoubleClick function) triggers + VCL child window focus events from this sub dialog which may + invalidate the member mpFocusWindow pointing to the target field + window. This would cause a crash with the following call to the + GrabFieldFocus function, if mpFocusWindow is used directly. */ + ScPivotFieldWindow& rTargetWindow = *mpFocusWindow; + + if( pBtn == &maBtnRemove ) { - aStr = FSTR(PIVOTSTR_SUM); - rFuncMask = PIVOT_FUNC_SUM; + rTargetWindow.RemoveSelectedField(); + // focus back to field window + GrabFieldFocus( rTargetWindow ); } - else + else if( pBtn == &maBtnOptions ) { - aStr = FSTR(PIVOTSTR_COUNT); - rFuncMask = PIVOT_FUNC_COUNT; + NotifyDoubleClick( rTargetWindow ); + // focus back to field window + GrabFieldFocus( rTargetWindow ); } } else if ( rFuncMask == PIVOT_FUNC_SUM ) aStr = FSTR(PIVOTSTR_SUM); @@ -1382,10 +1297,10 @@ bool ScDPLayoutDlg::GetPivotArrays( return true; } -void ScDPLayoutDlg::UpdateSrcRange() +IMPL_LINK( ScPivotLayoutDlg, OkHdl, OKButton *, EMPTYARG ) { String aSrcStr = aEdInPos.GetText(); - USHORT nResult = ScRange().Parse(aSrcStr, pDoc, pDoc->GetAddressConvention()); + sal_uInt16 nResult = ScRange().Parse(aSrcStr, pDoc, pDoc->GetAddressConvention()); DataSrcType eSrcType = SRC_INVALID; ScRange aNewRange; @@ -1450,7 +1365,7 @@ void ScDPLayoutDlg::UpdateSrcRange() } xDlgDPObject->SetSheetDesc(inSheet); - xDlgDPObject->FillOldParam( thePivotData, FALSE ); + xDlgDPObject->FillOldParam( thePivotData, false ); xDlgDPObject->FillLabelData(thePivotData); aLabelDataArr.clear(); @@ -1568,27 +1483,17 @@ void ScDPLayoutDlg::GetOtherDataArrays( //---------------------------------------------------------------------------- -void ScDPLayoutDlg::SetReference( const ScRange& rRef, ScDocument* pDocP ) -{ - if ( !bRefInputMode || !pEditActive ) - return; + ScDPSaveData* pOldSaveData = mxDlgDPObject->GetSaveData(); - if ( rRef.aStart != rRef.aEnd ) - RefInputStart( pEditActive ); + ScRange aOutRange( aAdrDest ); // bToNewTable is passed separately - if ( pEditActive == &aEdInPos ) - { - String aRefStr; - rRef.Format( aRefStr, SCR_ABS_3D, pDocP, pDocP->GetAddressConvention() ); - pEditActive->SetRefString( aRefStr ); - } - else if ( pEditActive == &aEdOutPos ) - { - String aRefStr; - rRef.aStart.Format( aRefStr, STD_FORMAT, pDocP, pDocP->GetAddressConvention() ); - pEditActive->SetRefString( aRefStr ); - } -} + ScDPSaveData aSaveData; + aSaveData.SetIgnoreEmptyRows( maBtnIgnEmptyRows.IsChecked() ); + aSaveData.SetRepeatIfEmpty( maBtnDetectCat.IsChecked() ); + aSaveData.SetColumnGrand( maBtnTotalCol.IsChecked() ); + aSaveData.SetRowGrand( maBtnTotalRow.IsChecked() ); + aSaveData.SetFilterButton( maBtnFilter.IsChecked() ); + aSaveData.SetDrillDown( maBtnDrillDown.IsChecked() ); //---------------------------------------------------------------------------- @@ -1641,8 +1546,8 @@ IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButton *, EMPTYARG ) { String aOutPosStr( aEdOutPos.GetText() ); ScAddress aAdrDest; - BOOL bToNewTable = (aLbOutPos.GetSelectEntryPos() == 1); - USHORT nResult = !bToNewTable ? aAdrDest.Parse( aOutPosStr, pDoc, pDoc->GetAddressConvention() ) : 0; + sal_Bool bToNewTable = (aLbOutPos.GetSelectEntryPos() == 1); + sal_uInt16 nResult = !bToNewTable ? aAdrDest.Parse( aOutPosStr, pDoc, pDoc->GetAddressConvention() ) : 0; if (!bToNewTable && (aOutPosStr.Len() == 0 || (nResult & SCA_VALID) != SCA_VALID)) { @@ -1720,6 +1625,7 @@ IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButton *, EMPTYARG ) pDim->SetSubtotalName(*pSubtotalName); } } + } bool bManualSort = ( aIt->maSortInfo.Mode == sheet::DataPilotFieldSortMode::MANUAL ); @@ -1762,12 +1668,12 @@ IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButton *, EMPTYARG ) } } - USHORT nWhichPivot = SC_MOD()->GetPool().GetWhich( SID_PIVOT_TABLE ); + sal_uInt16 nWhichPivot = SC_MOD()->GetPool().GetWhich( SID_PIVOT_TABLE ); ScPivotItem aOutItem( nWhichPivot, &aSaveData, &aOutRange, bToNewTable ); - bRefInputMode = FALSE; // to allow deselecting when switching sheets + bRefInputMode = false; // to allow deselecting when switching sheets - SetDispatcherLock( FALSE ); + SetDispatcherLock( false ); SwitchToDocument(); ScTabViewShell* pTabViewShell = pViewData->GetViewShell(); @@ -1811,29 +1717,25 @@ IMPL_LINK( ScDPLayoutDlg, CancelHdl, CancelButton *, EMPTYARG ) IMPL_LINK( ScDPLayoutDlg, MoreClickHdl, MoreButton *, EMPTYARG ) { - if ( aBtnMore.GetState() ) + if ( maBtnMore.GetState() ) { - bRefInputMode = TRUE; - //@BugID 54702 Enablen/Disablen nur noch in Basisklasse - //SFX_APPWINDOW->Enable(); - if ( aEdInPos.IsEnabled() ) + mbRefInputMode = true; + if ( maEdInPos.IsEnabled() ) { - aEdInPos.Enable(); - aEdInPos.GrabFocus(); - aEdInPos.Enable(); + maEdInPos.Enable(); + maEdInPos.GrabFocus(); + maEdInPos.Enable(); } else { - aEdOutPos.Enable(); - aEdOutPos.GrabFocus(); - aEdOutPos.Enable(); + maEdOutPos.Enable(); + maEdOutPos.GrabFocus(); + maEdOutPos.Enable(); } } else { - bRefInputMode = FALSE; - //@BugID 54702 Enablen/Disablen nur noch in Basisklasse - //SFX_APPWINDOW->Disable(FALSE); //! allgemeine Methode im ScAnyRefDlg + mbRefInputMode = false; } return 0; } @@ -1842,59 +1744,73 @@ IMPL_LINK( ScDPLayoutDlg, MoreClickHdl, MoreButton *, EMPTYARG ) IMPL_LINK( ScDPLayoutDlg, EdModifyHdl, Edit *, EMPTYARG ) { - String theCurPosStr = aEdOutPos.GetText(); - USHORT nResult = ScAddress().Parse( theCurPosStr, pDoc, pDoc->GetAddressConvention() ); + String theCurPosStr = maEdOutPos.GetText(); + sal_uInt16 nResult = ScAddress().Parse( theCurPosStr, mpDoc, mpDoc->GetAddressConvention() ); if ( SCA_VALID == (nResult & SCA_VALID) ) { - String* pStr = NULL; - BOOL bFound = FALSE; - USHORT i = 0; - USHORT nCount = aLbOutPos.GetEntryCount(); + String* pStr = 0; + bool bFound = false; + sal_uInt16 i = 0; + sal_uInt16 nCount = maLbOutPos.GetEntryCount(); for ( i=2; i<nCount && !bFound; i++ ) { - pStr = (String*)aLbOutPos.GetEntryData( i ); + pStr = (String*)maLbOutPos.GetEntryData( i ); bFound = (theCurPosStr == *pStr); } if ( bFound ) - aLbOutPos.SelectEntryPos( --i ); + maLbOutPos.SelectEntryPos( --i ); else - aLbOutPos.SelectEntryPos( 0 ); + maLbOutPos.SelectEntryPos( 0 ); } return 0; } IMPL_LINK( ScDPLayoutDlg, EdInModifyHdl, Edit *, EMPTYARG ) { - UpdateSrcRange(); - return 0; -} + String theCurPosStr = maEdInPos.GetText(); + sal_uInt16 nResult = ScRange().Parse( theCurPosStr, mpDoc, mpDoc->GetAddressConvention() ); //---------------------------------------------------------------------------- -IMPL_LINK( ScDPLayoutDlg, SelAreaHdl, ListBox *, EMPTYARG ) -{ - String aString; - USHORT nSelPos = aLbOutPos.GetSelectEntryPos(); + // new range is identical to the current range + if( inSheet.aSourceRange == aNewRange ) + return 0; - if ( nSelPos > 1 ) - { - aString = *(String*)aLbOutPos.GetEntryData( nSelPos ); - } - else if ( nSelPos == aLbOutPos.GetEntryCount()-1 ) // auf neue Tabelle? + ScTabViewShell* pTabViewShell = mpViewData->GetViewShell(); + inSheet.aSourceRange = aNewRange; + mxDlgDPObject->SetSheetDesc( inSheet ); + mxDlgDPObject->FillOldParam( maPivotData ); + mxDlgDPObject->FillLabelData( maPivotData ); + + // SetDialogDPObject does not take ownership but makes a copy internally + pTabViewShell->SetDialogDPObject( mxDlgDPObject.get() ); + + // re-initialize the field windows from the new data + InitFieldWindows(); + + return 0; +} + +IMPL_LINK( ScPivotLayoutDlg, SelAreaHdl, ListBox *, EMPTYARG ) +{ + String aString; + sal_uInt16 nSelPos = maLbOutPos.GetSelectEntryPos(); + if( nSelPos > 1 ) { - aEdOutPos.Disable(); - aRbOutPos.Disable(); + aString = *(String*)maLbOutPos.GetEntryData( nSelPos ); } else { - aEdOutPos.Enable(); - aRbOutPos.Enable(); + // do not allow to specify output position, if target is "new sheet" + bool bNewSheet = nSelPos == 1; + maEdOutPos.Enable( !bNewSheet ); + maRbOutPos.Enable( !bNewSheet ); } - aEdOutPos.SetText( aString ); + maEdOutPos.SetText( aString ); return 0; } @@ -1906,6 +1822,8 @@ IMPL_LINK( ScDPLayoutDlg, GetFocusHdl, Control*, pCtrl ) else if ( pCtrl == &aEdOutPos ) pEditActive = &aEdOutPos; + mpActiveEdit = dynamic_cast< ::formula::RefEdit* >( pEvent->GetWindow() ); + } return 0; } diff --git a/sc/source/ui/dbgui/scendlg.cxx b/sc/source/ui/dbgui/scendlg.cxx index 4f0207fd948d..466642b8e087 100644 --- a/sc/source/ui/dbgui/scendlg.cxx +++ b/sc/source/ui/dbgui/scendlg.cxx @@ -52,7 +52,7 @@ //======================================================================== -ScNewScenarioDlg::ScNewScenarioDlg( Window* pParent, const String& rName, BOOL bEdit, BOOL bSheetProtected) +ScNewScenarioDlg::ScNewScenarioDlg( Window* pParent, const String& rName, sal_Bool bEdit, sal_Bool bSheetProtected) : ModalDialog ( pParent, ScResId( RID_SCDLG_NEWSCENARIO ) ), aFlName ( this, ScResId( FL_NAME )), @@ -86,14 +86,14 @@ ScNewScenarioDlg::ScNewScenarioDlg( Window* pParent, const String& rName, BOOL b XColorTable* pColorTable = ((SvxColorTableItem*)pItem)->GetColorTable(); if (pColorTable) { - aLbColor.SetUpdateMode( FALSE ); + aLbColor.SetUpdateMode( false ); long nCount = pColorTable->Count(); for ( long n=0; n<nCount; n++ ) { XColorEntry* pEntry = pColorTable->GetColor(n); aLbColor.InsertEntry( pEntry->GetColor(), pEntry->GetName() ); } - aLbColor.SetUpdateMode( TRUE ); + aLbColor.SetUpdateMode( sal_True ); } } } @@ -118,31 +118,36 @@ ScNewScenarioDlg::ScNewScenarioDlg( Window* pParent, const String& rName, BOOL b aBtnOk .SetClickHdl( LINK( this, ScNewScenarioDlg, OkHdl ) ); aCbShowFrame.SetClickHdl( LINK( this, ScNewScenarioDlg, EnableHdl ) ); + aLbColor.SetAccessibleName(String(ScResId( STR_COLOR ) )); + FreeResource(); aLbColor.SelectEntry( Color( COL_LIGHTGRAY ) ); - aCbShowFrame.Check(TRUE); - //aCbPrintFrame.Check(TRUE); - aCbTwoWay.Check(TRUE); - //aCbAttrib.Check(FALSE); - //aCbValue.Check(FALSE); - aCbCopyAll.Check(FALSE); - aCbProtect.Check(TRUE); + aCbShowFrame.Check(sal_True); + //aCbPrintFrame.Check(sal_True); + aCbTwoWay.Check(sal_True); + //aCbAttrib.Check(sal_False); + //aCbValue.Check(sal_False); + aCbCopyAll.Check(false); + aCbProtect.Check(sal_True); if (bIsEdit) - aCbCopyAll.Enable(FALSE); + aCbCopyAll.Enable(false); // If the Sheet is protected then we disable the Scenario Protect input // and default it to true above. Note we are in 'Add' mode here as: if // Sheet && scenario protection are true, then we cannot edit this dialog. if (bSheetProtected) - aCbProtect.Enable(FALSE); + aCbProtect.Enable(false); //! die drei funktionieren noch nicht... /* - aCbPrintFrame.Enable(FALSE); - aCbAttrib.Enable(FALSE); - aCbValue.Enable(FALSE); + aCbPrintFrame.Enable(sal_False); + aCbAttrib.Enable(sal_False); + aCbValue.Enable(sal_False); */ + + aEdComment.SetAccessibleRelationMemberOf(&aFlComment); + aLbColor.SetAccessibleRelationLabeledBy(&aCbShowFrame); } //------------------------------------------------------------------------ @@ -154,7 +159,7 @@ ScNewScenarioDlg::~ScNewScenarioDlg() //------------------------------------------------------------------------ void ScNewScenarioDlg::GetScenarioData( String& rName, String& rComment, - Color& rColor, USHORT& rFlags ) const + Color& rColor, sal_uInt16& rFlags ) const { rComment = aEdComment.GetText(); rName = aEdName.GetText(); @@ -163,7 +168,7 @@ void ScNewScenarioDlg::GetScenarioData( String& rName, String& rComment, rName = aDefScenarioName; rColor = aLbColor.GetSelectEntryColor(); - USHORT nBits = 0; + sal_uInt16 nBits = 0; if (aCbShowFrame.IsChecked()) nBits |= SC_SCENARIO_SHOWFRAME; /* @@ -186,7 +191,7 @@ void ScNewScenarioDlg::GetScenarioData( String& rName, String& rComment, } void ScNewScenarioDlg::SetScenarioData( const String& rName, const String& rComment, - const Color& rColor, USHORT nFlags ) + const Color& rColor, sal_uInt16 nFlags ) { aEdComment.SetText(rComment); aEdName.SetText(rName); diff --git a/sc/source/ui/dbgui/scendlg.hrc b/sc/source/ui/dbgui/scendlg.hrc index 8fbf9a2d5b54..92f16e01d362 100644 --- a/sc/source/ui/dbgui/scendlg.hrc +++ b/sc/source/ui/dbgui/scendlg.hrc @@ -55,3 +55,6 @@ #define STR_CREATEDBY 31 #define STR_ON 32 #define STR_EDIT 33 +//IAccessibility2 Implementation 2009----- +#define STR_COLOR 34 +//-----IAccessibility2 Implementation 2009 diff --git a/sc/source/ui/dbgui/scendlg.src b/sc/source/ui/dbgui/scendlg.src index 1ca084b28e11..17f55fcc274d 100644 --- a/sc/source/ui/dbgui/scendlg.src +++ b/sc/source/ui/dbgui/scendlg.src @@ -29,6 +29,7 @@ #include "scendlg.hrc" ModalDialog RID_SCDLG_NEWSCENARIO { + HelpID = "sc:ModalDialog:RID_SCDLG_NEWSCENARIO"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 260 , 165 ) ; @@ -55,6 +56,7 @@ ModalDialog RID_SCDLG_NEWSCENARIO }; MultiLineEdit ED_COMMENT { + HelpID = "sc:MultiLineEdit:RID_SCDLG_NEWSCENARIO:ED_COMMENT"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 43 ) ; Size = MAP_APPFONT ( 183 , 46 ) ; @@ -65,6 +67,7 @@ ModalDialog RID_SCDLG_NEWSCENARIO }; Edit ED_NAME { + HelpID = "sc:Edit:RID_SCDLG_NEWSCENARIO:ED_NAME"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 183 , 12 ) ; @@ -72,12 +75,14 @@ ModalDialog RID_SCDLG_NEWSCENARIO }; CheckBox CB_SHOWFRAME { + HelpID = "sc:CheckBox:RID_SCDLG_NEWSCENARIO:CB_SHOWFRAME"; Pos = MAP_APPFONT ( 12 , 107 ) ; Size = MAP_APPFONT ( 109 , 10 ) ; Text [ en-US ] = "~Display border"; }; ListBox LB_COLOR { + HelpID = "sc:ListBox:RID_SCDLG_NEWSCENARIO:LB_COLOR"; Border = TRUE ; Pos = MAP_APPFONT ( 125 , 105 ) ; Size = MAP_APPFONT ( 70 , 86 ) ; @@ -86,6 +91,7 @@ ModalDialog RID_SCDLG_NEWSCENARIO }; CheckBox CB_PRINTFRAME { + HelpID = "sc:CheckBox:RID_SCDLG_NEWSCENARIO:CB_PRINTFRAME"; Hide = TRUE ; Pos = MAP_APPFONT ( 121 , 243 ) ; Size = MAP_APPFONT ( 83 , 10 ) ; @@ -93,12 +99,14 @@ ModalDialog RID_SCDLG_NEWSCENARIO }; CheckBox CB_TWOWAY { + HelpID = "sc:CheckBox:RID_SCDLG_NEWSCENARIO:CB_TWOWAY"; Pos = MAP_APPFONT ( 12 , 121 ) ; Size = MAP_APPFONT ( 183 , 10 ) ; Text [ en-US ] = "Copy ~back" ; }; CheckBox CB_ATTRIB { + HelpID = "sc:CheckBox:RID_SCDLG_NEWSCENARIO:CB_ATTRIB"; Hide = TRUE ; Pos = MAP_APPFONT ( 20 , 243 ) ; Size = MAP_APPFONT ( 83 , 10 ) ; @@ -106,6 +114,7 @@ ModalDialog RID_SCDLG_NEWSCENARIO }; CheckBox CB_VALUE { + HelpID = "sc:CheckBox:RID_SCDLG_NEWSCENARIO:CB_VALUE"; Hide = TRUE ; Pos = MAP_APPFONT ( 230 , 243 ) ; Size = MAP_APPFONT ( 83 , 10 ) ; @@ -113,12 +122,14 @@ ModalDialog RID_SCDLG_NEWSCENARIO }; CheckBox CB_COPYALL { + HelpID = "sc:CheckBox:RID_SCDLG_NEWSCENARIO:CB_COPYALL"; Pos = MAP_APPFONT ( 12 , 135 ) ; Size = MAP_APPFONT ( 183 , 10 ) ; Text [ en-US ] = "Copy ~entire sheet" ; }; CheckBox CB_PROTECT { + HelpID = "sc:CheckBox:RID_SCDLG_NEWSCENARIO:CB_PROTECT"; Pos = MAP_APPFONT ( 12 , 149 ) ; Size = MAP_APPFONT ( 183 , 10 ) ; Text [ en-US ] = "~Prevent changes" ; @@ -135,6 +146,10 @@ ModalDialog RID_SCDLG_NEWSCENARIO { Text [ en-US ] = "on" ; }; + String STR_COLOR + { + Text [ en-US ] = "Display border in" ; + }; FixedLine FL_NAME { Pos = MAP_APPFONT ( 6 , 3 ) ; diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx index 640f9213a519..743fb1044a91 100644 --- a/sc/source/ui/dbgui/scuiasciiopt.cxx +++ b/sc/source/ui/dbgui/scuiasciiopt.cxx @@ -47,13 +47,8 @@ #include <com/sun/star/uno/Sequence.hxx> #include "miscuno.hxx" - //! TODO make dynamic -#ifdef WIN -const SCSIZE ASCIIDLG_MAXROWS = 10000; -#else const SCSIZE ASCIIDLG_MAXROWS = MAXROWCOUNT; -#endif using namespace com::sun::star::uno; @@ -280,7 +275,7 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, OUString sTextSeparators(mcTextSep); bool bMergeDelimiters = false; bool bFixedWidth = false; - bool bQuotedFieldAsText = true; + bool bQuotedFieldAsText = false; bool bDetectSpecialNum = false; sal_Int32 nFromRow = 1; sal_Int32 nCharSet = -1; @@ -323,34 +318,45 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, maFieldSeparators = GetSeparators(); // Clipboard is always Unicode, else detect. - bool bPreselectUnicode = !mbFileImport; + rtl_TextEncoding ePreselectUnicode = (mbFileImport ? + RTL_TEXTENCODING_DONTKNOW : RTL_TEXTENCODING_UNICODE); // Sniff for Unicode / not - if( !bPreselectUnicode && mpDatStream ) + if( ePreselectUnicode == RTL_TEXTENCODING_DONTKNOW && mpDatStream ) { Seek( 0 ); - mpDatStream->StartReadingUnicodeText(); - ULONG nUniPos = mpDatStream->Tell(); - if ( nUniPos > 0 ) - bPreselectUnicode = TRUE; // read 0xfeff/0xfffe - else + mpDatStream->StartReadingUnicodeText( RTL_TEXTENCODING_DONTKNOW ); + sal_uLong nUniPos = mpDatStream->Tell(); + switch (nUniPos) { - UINT16 n; - *mpDatStream >> n; - // Assume that normal ASCII/ANSI/ISO/etc. text doesn't start with - // control characters except CR,LF,TAB - if ( (n & 0xff00) < 0x2000 ) - { - switch ( n & 0xff00 ) + case 2: + ePreselectUnicode = RTL_TEXTENCODING_UNICODE; // UTF-16 + break; + case 3: + ePreselectUnicode = RTL_TEXTENCODING_UTF8; // UTF-8 + break; + case 0: { - case 0x0900 : - case 0x0a00 : - case 0x0d00 : - break; - default: - bPreselectUnicode = TRUE; + sal_uInt16 n; + *mpDatStream >> n; + // Assume that normal ASCII/ANSI/ISO/etc. text doesn't start with + // control characters except CR,LF,TAB + if ( (n & 0xff00) < 0x2000 ) + { + switch ( n & 0xff00 ) + { + case 0x0900 : + case 0x0a00 : + case 0x0d00 : + break; + default: + ePreselectUnicode = RTL_TEXTENCODING_UNICODE; // UTF-16 + } + } + mpDatStream->Seek(0); } - } - mpDatStream->Seek(0); + break; + default: + ; // nothing } mnStreamPos = mpDatStream->Tell(); } @@ -376,15 +382,15 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, // *** text encoding ListBox *** // all encodings allowed, including Unicode, but subsets are excluded - aLbCharSet.FillFromTextEncodingTable( TRUE ); + aLbCharSet.FillFromTextEncodingTable( sal_True ); // Insert one "SYSTEM" entry for compatibility in AsciiOptions and system // independent document linkage. aLbCharSet.InsertTextEncoding( RTL_TEXTENCODING_DONTKNOW, aCharSetUser ); - aLbCharSet.SelectTextEncoding( bPreselectUnicode ? - RTL_TEXTENCODING_UNICODE : gsl_getSystemTextEncoding() ); + aLbCharSet.SelectTextEncoding( ePreselectUnicode == RTL_TEXTENCODING_DONTKNOW ? + gsl_getSystemTextEncoding() : ePreselectUnicode ); - if( nCharSet >= 0 ) - aLbCharSet.SelectEntryPos( static_cast<USHORT>(nCharSet) ); + if( nCharSet >= 0 && ePreselectUnicode == RTL_TEXTENCODING_DONTKNOW ) + aLbCharSet.SelectEntryPos( static_cast<sal_uInt16>(nCharSet) ); SetSelectedCharSet(); aLbCharSet.SetSelectHdl( LINK( this, ScImportAsciiDlg, CharSetHdl ) ); @@ -418,6 +424,9 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, UpdateVertical(); maTableBox.Execute( CSVCMD_NEWCELLTEXTS ); + + aEdOther.SetAccessibleName(aCkbOther.GetText()); + aEdOther.SetAccessibleRelationLabeledBy(&aCkbOther); } @@ -429,7 +438,7 @@ ScImportAsciiDlg::~ScImportAsciiDlg() // ---------------------------------------------------------------------------- -bool ScImportAsciiDlg::GetLine( ULONG nLine, String &rText ) +bool ScImportAsciiDlg::GetLine( sal_uLong nLine, String &rText ) { if (nLine >= ASCIIDLG_MAXROWS || !mpDatStream) return false; @@ -438,15 +447,14 @@ bool ScImportAsciiDlg::GetLine( ULONG nLine, String &rText ) bool bFixed = aRbFixed.IsChecked(); if (!mpRowPosArray) - mpRowPosArray = new ULONG[ASCIIDLG_MAXROWS + 2]; + mpRowPosArray = new sal_uLong[ASCIIDLG_MAXROWS + 2]; if (!mnRowPosCount) // complete re-fresh { memset( mpRowPosArray, 0, sizeof(mpRowPosArray[0]) * (ASCIIDLG_MAXROWS+2)); Seek(0); - if ( mpDatStream->GetStreamCharSet() == RTL_TEXTENCODING_UNICODE ) - mpDatStream->StartReadingUnicodeText(); + mpDatStream->StartReadingUnicodeText( mpDatStream->GetStreamCharSet() ); mnStreamPos = mpDatStream->Tell(); mpRowPosArray[mnRowPosCount] = mnStreamPos; @@ -576,7 +584,7 @@ String ScImportAsciiDlg::GetSeparators() const void ScImportAsciiDlg::SetupSeparatorCtrls() { - BOOL bEnable = aRbSeparated.IsChecked(); + sal_Bool bEnable = aRbSeparated.IsChecked(); aCkbTab.Enable( bEnable ); aCkbSemicolon.Enable( bEnable ); aCkbComma.Enable( bEnable ); @@ -696,7 +704,7 @@ IMPL_LINK( ScImportAsciiDlg, UpdateTextHdl, ScCsvTableBox*, EMPTYARG ) maPreviewLine[i].Erase(); maTableBox.Execute( CSVCMD_SETLINECOUNT, mnRowPosCount); - bool bMergeSep = (aCkbAsOnce.IsChecked() == TRUE); + bool bMergeSep = (aCkbAsOnce.IsChecked() == sal_True); maTableBox.SetUniStrings( maPreviewLine, maFieldSeparators, mcTextSep, bMergeSep); return 0; diff --git a/sc/source/ui/dbgui/scuiimoptdlg.cxx b/sc/source/ui/dbgui/scuiimoptdlg.cxx index a6ee4ce71cb8..4fa3e6868875 100644 --- a/sc/source/ui/dbgui/scuiimoptdlg.cxx +++ b/sc/source/ui/dbgui/scuiimoptdlg.cxx @@ -51,7 +51,7 @@ public: nIter ( 0 ) {} - USHORT GetCode( const String& rDelimiter ) const; + sal_uInt16 GetCode( const String& rDelimiter ) const; String GetDelimiter( sal_Unicode nCode ) const; String FirstDel() { nIter = 0; return theDelTab.GetToken( nIter, cSep ); } @@ -66,7 +66,7 @@ private: //------------------------------------------------------------------------ -USHORT ScDelimiterTable::GetCode( const String& rDel ) const +sal_uInt16 ScDelimiterTable::GetCode( const String& rDel ) const { sal_Unicode nCode = 0; @@ -118,12 +118,12 @@ String ScDelimiterTable::GetDelimiter( sal_Unicode nCode ) const ScImportOptionsDlg::ScImportOptionsDlg( Window* pParent, - BOOL bAscii, + sal_Bool bAscii, const ScImportOptions* pOptions, const String* pStrTitle, - BOOL bMultiByte, - BOOL bOnlyDbtoolsEncodings, - BOOL bImport ) + sal_Bool bMultiByte, + sal_Bool bOnlyDbtoolsEncodings, + sal_Bool bImport ) : ModalDialog ( pParent, ScResId( RID_SCDLG_IMPORTOPT ) ), aFlFieldOpt ( this, ScResId( FL_FIELDOPT ) ), @@ -133,11 +133,12 @@ ScImportOptionsDlg::ScImportOptionsDlg( aEdFieldSep ( this, ScResId( ED_FIELDSEP ) ), aFtTextSep ( this, ScResId( FT_TEXTSEP ) ), aEdTextSep ( this, ScResId( ED_TEXTSEP ) ), + aCbQuoteAll ( this, ScResId( CB_QUOTEALL ) ), + aCbShown ( this, ScResId( CB_SAVESHOWN ) ), aCbFixed ( this, ScResId( CB_FIXEDWIDTH ) ), aBtnOk ( this, ScResId( BTN_OK ) ), aBtnCancel ( this, ScResId( BTN_CANCEL ) ), - aBtnHelp ( this, ScResId( BTN_HELP ) ), - aCbShown ( this, ScResId( CB_SAVESHOWN ) ) + aBtnHelp ( this, ScResId( BTN_HELP ) ) { // im Ctor-Initializer nicht moeglich (MSC kann das nicht): pFieldSepTab = new ScDelimiterTable( String(ScResId(SCSTR_FIELDSEP)) ); @@ -212,9 +213,11 @@ ScImportOptionsDlg::ScImportOptionsDlg( SetSizePixel( aWinSize ); aCbFixed.Show(); aCbFixed.SetClickHdl( LINK( this, ScImportOptionsDlg, FixedWidthHdl ) ); - aCbFixed.Check( FALSE ); + aCbFixed.Check( false ); aCbShown.Show(); - aCbShown.Check( TRUE ); + aCbShown.Check( sal_True ); + aCbQuoteAll.Show(); + aCbQuoteAll.Check( false ); } else { @@ -226,6 +229,7 @@ ScImportOptionsDlg::ScImportOptionsDlg( aEdTextSep.Hide(); aCbFixed.Hide(); aCbShown.Hide(); + aCbQuoteAll.Hide(); aLbFont.GrabFocus(); aLbFont.SetDoubleClickHdl( LINK( this, ScImportOptionsDlg, DoubleClickHdl ) ); } @@ -260,16 +264,17 @@ void ScImportOptionsDlg::GetImportOptions( ScImportOptions& rOptions ) const rOptions.nTextSepCode = GetCodeFromCombo( aEdTextSep ); rOptions.bFixedWidth = aCbFixed.IsChecked(); rOptions.bSaveAsShown = aCbShown.IsChecked(); + rOptions.bQuoteAllText = aCbQuoteAll.IsChecked(); } } //------------------------------------------------------------------------ -USHORT ScImportOptionsDlg::GetCodeFromCombo( const ComboBox& rEd ) const +sal_uInt16 ScImportOptionsDlg::GetCodeFromCombo( const ComboBox& rEd ) const { ScDelimiterTable* pTab; String aStr( rEd.GetText() ); - USHORT nCode; + sal_uInt16 nCode; if ( &rEd == &aEdTextSep ) pTab = pTextSepTab; @@ -285,7 +290,7 @@ USHORT ScImportOptionsDlg::GetCodeFromCombo( const ComboBox& rEd ) const nCode = pTab->GetCode( aStr ); if ( nCode == 0 ) - nCode = (USHORT)aStr.GetChar(0); + nCode = (sal_uInt16)aStr.GetChar(0); } return nCode; @@ -297,12 +302,13 @@ IMPL_LINK( ScImportOptionsDlg, FixedWidthHdl, CheckBox*, pCheckBox ) { if( pCheckBox == &aCbFixed ) { - BOOL bEnable = !aCbFixed.IsChecked(); + sal_Bool bEnable = !aCbFixed.IsChecked(); aFtFieldSep.Enable( bEnable ); aEdFieldSep.Enable( bEnable ); aFtTextSep.Enable( bEnable ); aEdTextSep.Enable( bEnable ); aCbShown.Enable( bEnable ); + aCbQuoteAll.Enable( bEnable ); } return 0; } diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx index e7bfecfdea3d..e0fcb9936c96 100644 --- a/sc/source/ui/dbgui/sfiltdlg.cxx +++ b/sc/source/ui/dbgui/sfiltdlg.cxx @@ -71,8 +71,8 @@ ScSpecialFilterDlg::ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Wi : ScAnyRefDlg ( pB, pCW, pParent, RID_SCDLG_SPEC_FILTER ), // - aLbFilterArea ( this, ScResId( LB_CRITERIA_AREA ) ), aFtFilterArea ( this, ScResId( FT_CRITERIA_AREA ) ), + aLbFilterArea ( this, ScResId( LB_CRITERIA_AREA ) ), aEdFilterArea ( this, this, ScResId( ED_CRITERIA_AREA ) ), aRbFilterArea ( this, ScResId( RB_CRITERIA_AREA ), &aEdFilterArea, this ), // @@ -91,7 +91,7 @@ ScSpecialFilterDlg::ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Wi pViewData ( NULL ), pDoc ( NULL ), pRefInputEdit ( NULL ), - bRefInputMode ( FALSE ), + bRefInputMode ( false ), pTimer ( NULL ) { Init( rArgSet ); @@ -104,6 +104,11 @@ ScSpecialFilterDlg::ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Wi pTimer->SetTimeout( 50 ); // 50ms warten pTimer->SetTimeoutHdl( LINK( this, ScSpecialFilterDlg, TimeOutHdl ) ); pTimer->Start(); + + aLbCopyArea.SetAccessibleName(aBtnCopyResult.GetText()); + aEdCopyArea.SetAccessibleName(aBtnCopyResult.GetText()); + aLbCopyArea.SetAccessibleRelationLabeledBy(&aBtnCopyResult); + aEdCopyArea.SetAccessibleRelationLabeledBy(&aBtnCopyResult); } @@ -111,8 +116,8 @@ ScSpecialFilterDlg::ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Wi ScSpecialFilterDlg::~ScSpecialFilterDlg() { - USHORT nEntries = aLbFilterArea.GetEntryCount(); - USHORT i; + sal_uInt16 nEntries = aLbFilterArea.GetEntryCount(); + sal_uInt16 i; for ( i=1; i<nEntries; i++ ) delete (String*)aLbFilterArea.GetEntryData( i ); @@ -156,7 +161,7 @@ void ScSpecialFilterDlg::Init( const SfxItemSet& rArgSet ) if (!pRangeNames->empty()) { ScRangeName::const_iterator itr = pRangeNames->begin(), itrEnd = pRangeNames->end(); - USHORT nInsert = 0; + sal_uInt16 nInsert = 0; for (; itr != itrEnd; ++itr) { if (!itr->HasType(RT_CRITERIA)) @@ -205,19 +210,19 @@ void ScSpecialFilterDlg::Init( const SfxItemSet& rArgSet ) aStrUndefined ); // Spezialfilter braucht immer Spaltenkoepfe - aBtnHeader.Check(TRUE); + aBtnHeader.Check(true); aBtnHeader.Disable(); // Modal-Modus einschalten -// SetDispatcherLock( TRUE ); +// SetDispatcherLock( sal_True ); //@BugID 54702 Enablen/Disablen nur noch in Basisklasse - //SFX_APPWINDOW->Disable(FALSE); //! allgemeine Methode im ScAnyRefDlg + //SFX_APPWINDOW->Disable(sal_False); //! allgemeine Methode im ScAnyRefDlg } //---------------------------------------------------------------------------- -BOOL ScSpecialFilterDlg::Close() +sal_Bool ScSpecialFilterDlg::Close() { if (pViewData) pViewData->GetDocShell()->CancelAutoDBRange(); @@ -290,7 +295,7 @@ ScQueryItem* ScSpecialFilterDlg::GetOutputItem( const ScQueryParam& rParam, //---------------------------------------------------------------------------- -BOOL ScSpecialFilterDlg::IsRefInputMode() const +sal_Bool ScSpecialFilterDlg::IsRefInputMode() const { return bRefInputMode; } @@ -310,8 +315,8 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn ) String theAreaStr( aEdFilterArea.GetText() ); ScQueryParam theOutParam( theQueryData ); ScAddress theAdrCopy; - BOOL bEditInputOk = TRUE; - BOOL bQueryOk = FALSE; + sal_Bool bEditInputOk = sal_True; + sal_Bool bQueryOk = false; ScRange theFilterArea; const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention(); @@ -322,28 +327,28 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn ) if ( STRING_NOTFOUND != nColonPos ) theCopyStr.Erase( nColonPos ); - USHORT nResult = theAdrCopy.Parse( theCopyStr, pDoc, eConv ); + sal_uInt16 nResult = theAdrCopy.Parse( theCopyStr, pDoc, eConv ); if ( SCA_VALID != (nResult & SCA_VALID) ) { if ( !aBtnMore.GetState() ) - aBtnMore.SetState( TRUE ); + aBtnMore.SetState( sal_True ); ERRORBOX( STR_INVALID_TABREF ); aEdCopyArea.GrabFocus(); - bEditInputOk = FALSE; + bEditInputOk = false; } } if ( bEditInputOk ) { - USHORT nResult = ScRange().Parse( theAreaStr, pDoc, eConv ); + sal_uInt16 nResult = ScRange().Parse( theAreaStr, pDoc, eConv ); if ( SCA_VALID != (nResult & SCA_VALID) ) { ERRORBOX( STR_INVALID_TABREF ); aEdFilterArea.GrabFocus(); - bEditInputOk = FALSE; + bEditInputOk = false; } } @@ -355,7 +360,7 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn ) * ein ScQueryParam zu erzeugen: */ - USHORT nResult = theFilterArea.Parse( theAreaStr, pDoc, eConv ); + sal_uInt16 nResult = theFilterArea.Parse( theAreaStr, pDoc, eConv ); if ( SCA_VALID == (nResult & SCA_VALID) ) { @@ -364,21 +369,21 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn ) if ( aBtnCopyResult.IsChecked() ) { - theOutParam.bInplace = FALSE; + theOutParam.bInplace = false; theOutParam.nDestTab = theAdrCopy.Tab(); theOutParam.nDestCol = theAdrCopy.Col(); theOutParam.nDestRow = theAdrCopy.Row(); } else { - theOutParam.bInplace = TRUE; + theOutParam.bInplace = sal_True; theOutParam.nDestTab = 0; theOutParam.nDestCol = 0; theOutParam.nDestRow = 0; } theOutParam.bHasHeader = aBtnHeader.IsChecked(); - theOutParam.bByRow = TRUE; + theOutParam.bByRow = sal_True; theOutParam.bCaseSens = aBtnCase.IsChecked(); theOutParam.bRegExp = aBtnRegExp.IsChecked(); theOutParam.bDuplicate = !aBtnUnique.IsChecked(); @@ -398,7 +403,7 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn ) if ( bQueryOk && theOutParam.GetEntryCount() > MAXQUERY && theOutParam.GetEntry(MAXQUERY).bDoQuery ) { - bQueryOk = FALSE; // zu viele + bQueryOk = false; // zu viele //! andere Fehlermeldung ?? } } @@ -406,7 +411,7 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn ) if ( bQueryOk ) { - SetDispatcherLock( FALSE ); + SetDispatcherLock( false ); SwitchToDocument(); GetBindings().GetDispatcher()->Execute( FID_FILTER_OK, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD, @@ -438,17 +443,17 @@ IMPL_LINK( ScSpecialFilterDlg, TimeOutHdl, Timer*, _pTimer ) if( aEdCopyArea.HasFocus() || aRbCopyArea.HasFocus() ) { pRefInputEdit = &aEdCopyArea; - bRefInputMode = TRUE; + bRefInputMode = sal_True; } else if( aEdFilterArea.HasFocus() || aRbFilterArea.HasFocus() ) { pRefInputEdit = &aEdFilterArea; - bRefInputMode = TRUE; + bRefInputMode = sal_True; } else if( bRefInputMode ) { pRefInputEdit = NULL; - bRefInputMode = FALSE; + bRefInputMode = false; } } @@ -465,7 +470,7 @@ IMPL_LINK( ScSpecialFilterDlg, FilterAreaSelHdl, ListBox*, pLb ) if ( pLb == &aLbFilterArea ) { String aString; - USHORT nSelPos = aLbFilterArea.GetSelectEntryPos(); + sal_uInt16 nSelPos = aLbFilterArea.GetSelectEntryPos(); if ( nSelPos > 0 ) aString = *(String*)aLbFilterArea.GetEntryData( nSelPos ); @@ -486,14 +491,14 @@ IMPL_LINK( ScSpecialFilterDlg, FilterAreaModHdl, formula::RefEdit*, pEd ) if ( pDoc && pViewData ) { String theCurAreaStr = pEd->GetText(); - USHORT nResult = ScRange().Parse( theCurAreaStr, pDoc ); + sal_uInt16 nResult = ScRange().Parse( theCurAreaStr, pDoc ); if ( SCA_VALID == (nResult & SCA_VALID) ) { String* pStr = NULL; - BOOL bFound = FALSE; - USHORT i = 0; - USHORT nCount = aLbFilterArea.GetEntryCount(); + sal_Bool bFound = false; + sal_uInt16 i = 0; + sal_uInt16 nCount = aLbFilterArea.GetEntryCount(); for ( i=1; i<nCount && !bFound; i++ ) { diff --git a/sc/source/ui/dbgui/sortdlg.cxx b/sc/source/ui/dbgui/sortdlg.cxx index 1651a7ab1dda..57b75c8e2d7e 100644 --- a/sc/source/ui/dbgui/sortdlg.cxx +++ b/sc/source/ui/dbgui/sortdlg.cxx @@ -47,8 +47,8 @@ ScSortDlg::ScSortDlg( Window* pParent, SfxTabDialog( pParent, ScResId( RID_SCDLG_SORT ), pArgSet ), - bIsHeaders ( FALSE ), - bIsByRows ( FALSE ) + bIsHeaders ( false ), + bIsByRows ( false ) { #if LAYOUT_SFX_TABDIALOG_BROKEN @@ -56,9 +56,9 @@ ScSortDlg::ScSortDlg( Window* pParent, AddTabPage( TP_OPTIONS, ScTabPageSortOptions::Create, 0 ); #else String fields = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("fields")); - AddTabPage( TP_FIELDS, fields, ScTabPageSortFields::Create, 0, FALSE, TAB_APPEND); + AddTabPage( TP_FIELDS, fields, ScTabPageSortFields::Create, 0, false, TAB_APPEND); String options = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("options")); - AddTabPage( TP_OPTIONS, options, ScTabPageSortOptions::Create, 0, FALSE, TAB_APPEND); + AddTabPage( TP_OPTIONS, options, ScTabPageSortOptions::Create, 0, false, TAB_APPEND); #endif FreeResource(); } diff --git a/sc/source/ui/dbgui/textimportoptions.src b/sc/source/ui/dbgui/textimportoptions.src index a2d453555bb9..ea0b9390228b 100644 --- a/sc/source/ui/dbgui/textimportoptions.src +++ b/sc/source/ui/dbgui/textimportoptions.src @@ -29,6 +29,7 @@ ModalDialog RID_SCDLG_TEXT_IMPORT_OPTIONS { + HelpID = "sc:ModalDialog:RID_SCDLG_TEXT_IMPORT_OPTIONS"; Text [ en-US ] = "Import Options" ; Size = MAP_APPFONT ( 230 , 101 ) ; Moveable = TRUE ; @@ -64,6 +65,7 @@ ModalDialog RID_SCDLG_TEXT_IMPORT_OPTIONS RadioButton RB_AUTOMATIC { + HelpID = "sc:RadioButton:RID_SCDLG_TEXT_IMPORT_OPTIONS:RB_AUTOMATIC"; Pos = MAP_APPFONT( 12, 20 ) ; Size = MAP_APPFONT( 159, 10 ) ; TabStop = TRUE ; @@ -73,6 +75,7 @@ ModalDialog RID_SCDLG_TEXT_IMPORT_OPTIONS RadioButton RB_CUSTOM { + HelpID = "sc:RadioButton:RID_SCDLG_TEXT_IMPORT_OPTIONS:RB_CUSTOM"; Pos = MAP_APPFONT( 12, 34 ) ; Size = MAP_APPFONT( 159, 10 ) ; TabStop = TRUE ; @@ -82,6 +85,7 @@ ModalDialog RID_SCDLG_TEXT_IMPORT_OPTIONS ListBox LB_CUSTOM_LANG { + HelpID = "sc:ListBox:RID_SCDLG_TEXT_IMPORT_OPTIONS:LB_CUSTOM_LANG"; Pos = MAP_APPFONT( 20, 50 ) ; Size = MAP_APPFONT( 140, 120 ) ; TabStop = TRUE ; @@ -98,6 +102,7 @@ ModalDialog RID_SCDLG_TEXT_IMPORT_OPTIONS CheckBox BTN_CONVERT_DATE { + HelpID = "sc:CheckBox:RID_SCDLG_TEXT_IMPORT_OPTIONS:BTN_CONVERT_DATE"; Pos = MAP_APPFONT( 12, 86 ); Size = MAP_APPFONT( 159, 10 ); TabStop = TRUE ; diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx index 44676b136e14..6974e7d2135a 100644 --- a/sc/source/ui/dbgui/tpsort.cxx +++ b/sc/source/ui/dbgui/tpsort.cxx @@ -61,7 +61,7 @@ using namespace com::sun::star; // STATIC DATA ----------------------------------------------------------- -static USHORT pSortRanges[] = +static sal_uInt16 pSortRanges[] = { SID_SORT, SID_SORT, @@ -81,7 +81,7 @@ static USHORT pSortRanges[] = * * Die Klasse SfxTabPage bietet mittlerweile ein Verfahren an: * - * virtual BOOL HasExchangeSupport() const; -> return TRUE; + * virtual sal_Bool HasExchangeSupport() const; -> return sal_True; * virtual void ActivatePage(const SfxItemSet &); * virtual int DeactivatePage(SfxItemSet * = 0); * @@ -125,8 +125,8 @@ ScTabPageSortFields::ScTabPageSortFields( Window* pParent, rArgSet.Get( nWhichSort )). GetSortData() ), nFieldCount ( 0 ), - bHasHeader ( FALSE ), - bSortByRows ( FALSE ) + bHasHeader ( false ), + bSortByRows ( false ) { Init(); FreeResource(); @@ -177,7 +177,7 @@ void ScTabPageSortFields::Init() //------------------------------------------------------------------------ -USHORT* ScTabPageSortFields::GetRanges() +sal_uInt16* ScTabPageSortFields::GetRanges() { return pSortRanges; } @@ -204,7 +204,7 @@ void ScTabPageSortFields::Reset( const SfxItemSet& /* rArgSet */ ) if ( rSortData.bDoSort[0] ) { - for ( USHORT i=0; i<3; i++ ) + for ( sal_uInt16 i=0; i<3; i++ ) { if ( rSortData.bDoSort[i] ) { @@ -239,7 +239,7 @@ void ScTabPageSortFields::Reset( const SfxItemSet& /* rArgSet */ ) else if( nCol > rSortData.nCol2 ) nCol = rSortData.nCol2; - USHORT nSort1Pos = nCol - rSortData.nCol1+1; + sal_uInt16 nSort1Pos = nCol - rSortData.nCol1+1; aLbSort1.SelectEntryPos( nSort1Pos ); aLbSort2.SelectEntryPos( 0 ); aLbSort3.SelectEntryPos( 0 ); @@ -260,20 +260,20 @@ void ScTabPageSortFields::Reset( const SfxItemSet& /* rArgSet */ ) // ----------------------------------------------------------------------- -BOOL ScTabPageSortFields::FillItemSet( SfxItemSet& rArgSet ) +sal_Bool ScTabPageSortFields::FillItemSet( SfxItemSet& rArgSet ) { ScSortParam theSortData = rSortData; if (pDlg) { const SfxItemSet* pExample = pDlg->GetExampleSet(); const SfxPoolItem* pItem; - if ( pExample && pExample->GetItemState( nWhichSort, TRUE, &pItem ) == SFX_ITEM_SET ) + if ( pExample && pExample->GetItemState( nWhichSort, sal_True, &pItem ) == SFX_ITEM_SET ) theSortData = ((const ScSortItem*)pItem)->GetSortData(); } - USHORT nSort1Pos = aLbSort1.GetSelectEntryPos(); - USHORT nSort2Pos = aLbSort2.GetSelectEntryPos(); - USHORT nSort3Pos = aLbSort3.GetSelectEntryPos(); + sal_uInt16 nSort1Pos = aLbSort1.GetSelectEntryPos(); + sal_uInt16 nSort2Pos = aLbSort2.GetSelectEntryPos(); + sal_uInt16 nSort3Pos = aLbSort3.GetSelectEntryPos(); DBG_ASSERT( (nSort1Pos <= SC_MAXFIELDS) && (nSort2Pos <= SC_MAXFIELDS) @@ -318,12 +318,12 @@ BOOL ScTabPageSortFields::FillItemSet( SfxItemSet& rArgSet ) { theSortData.bDoSort[0] = theSortData.bDoSort[1] = - theSortData.bDoSort[2] = FALSE; + theSortData.bDoSort[2] = false; } rArgSet.Put( ScSortItem( SCITEM_SORTDATA, NULL, &theSortData ) ); - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -337,9 +337,9 @@ void ScTabPageSortFields::ActivatePage() if ( bHasHeader != pDlg->GetHeaders() || bSortByRows != pDlg->GetByRows() ) { - USHORT nCurSel1 = aLbSort1.GetSelectEntryPos(); - USHORT nCurSel2 = aLbSort2.GetSelectEntryPos(); - USHORT nCurSel3 = aLbSort3.GetSelectEntryPos(); + sal_uInt16 nCurSel1 = aLbSort1.GetSelectEntryPos(); + sal_uInt16 nCurSel2 = aLbSort2.GetSelectEntryPos(); + sal_uInt16 nCurSel3 = aLbSort3.GetSelectEntryPos(); bHasHeader = pDlg->GetHeaders(); bSortByRows = pDlg->GetByRows(); @@ -372,7 +372,7 @@ int ScTabPageSortFields::DeactivatePage( SfxItemSet* pSetP ) // ----------------------------------------------------------------------- -void ScTabPageSortFields::DisableField( USHORT nField ) +void ScTabPageSortFields::DisableField( sal_uInt16 nField ) { nField--; @@ -387,7 +387,7 @@ void ScTabPageSortFields::DisableField( USHORT nField ) // ----------------------------------------------------------------------- -void ScTabPageSortFields::EnableField( USHORT nField ) +void ScTabPageSortFields::EnableField( sal_uInt16 nField ) { nField--; @@ -420,7 +420,7 @@ void ScTabPageSortFields::FillFieldLists() SCCOL nFirstSortCol = rSortData.nCol1; SCROW nFirstSortRow = rSortData.nRow1; SCTAB nTab = pViewData->GetTabNo(); - USHORT i = 1; + sal_uInt16 i = 1; if ( bSortByRows ) { @@ -473,17 +473,17 @@ void ScTabPageSortFields::FillFieldLists() //------------------------------------------------------------------------ -USHORT ScTabPageSortFields::GetFieldSelPos( SCCOLROW nField ) +sal_uInt16 ScTabPageSortFields::GetFieldSelPos( SCCOLROW nField ) { - USHORT nFieldPos = 0; - BOOL bFound = FALSE; + sal_uInt16 nFieldPos = 0; + sal_Bool bFound = false; - for ( USHORT n=1; n<nFieldCount && !bFound; n++ ) + for ( sal_uInt16 n=1; n<nFieldCount && !bFound; n++ ) { if ( nFieldArr[n] == nField ) { nFieldPos = n; - bFound = TRUE; + bFound = sal_True; } } @@ -596,15 +596,22 @@ ScTabPageSortOptions::ScTabPageSortOptions( Window* pParent, Init(); FreeResource(); SetExchangeSupport(); + + aLbOutPos.SetAccessibleRelationLabeledBy(&aBtnCopyResult); + aLbOutPos.SetAccessibleName(aBtnCopyResult.GetText()); + aEdOutPos.SetAccessibleRelationLabeledBy(&aBtnCopyResult); + aEdOutPos.SetAccessibleName(aBtnCopyResult.GetText()); + aLbSortUser.SetAccessibleRelationLabeledBy(&aBtnSortUser); + aLbSortUser.SetAccessibleName(aBtnSortUser.GetText()); } // ----------------------------------------------------------------------- ScTabPageSortOptions::~ScTabPageSortOptions() { - USHORT nEntries = aLbOutPos.GetEntryCount(); + sal_uInt16 nEntries = aLbOutPos.GetEntryCount(); - for ( USHORT i=1; i<nEntries; i++ ) + for ( sal_uInt16 i=1; i<nEntries; i++ ) delete (String*)aLbOutPos.GetEntryData( i ); delete pColRes; @@ -655,7 +662,7 @@ void ScTabPageSortOptions::Init() String aRefStr; while ( aIter.Next( aName, aRange ) ) { - USHORT nInsert = aLbOutPos.InsertEntry( aName ); + sal_uInt16 nInsert = aLbOutPos.InsertEntry( aName ); aRange.aStart.Format( aRefStr, SCA_ABS_3D, pDoc, eConv ); aLbOutPos.SetEntryData( nInsert, new String( aRefStr ) ); @@ -698,13 +705,13 @@ void ScTabPageSortOptions::Init() // get available languages - aLbLanguage.SetLanguageList( LANG_LIST_ALL | LANG_LIST_ONLY_KNOWN, FALSE ); + aLbLanguage.SetLanguageList( LANG_LIST_ALL | LANG_LIST_ONLY_KNOWN, false ); aLbLanguage.InsertLanguage( LANGUAGE_SYSTEM ); } //------------------------------------------------------------------------ -USHORT* ScTabPageSortOptions::GetRanges() +sal_uInt16* ScTabPageSortOptions::GetRanges() { return pSortRanges; } @@ -727,13 +734,13 @@ void ScTabPageSortOptions::Reset( const SfxItemSet& /* rArgSet */ ) { if ( rSortData.bUserDef ) { - aBtnSortUser.Check( TRUE ); + aBtnSortUser.Check( sal_True ); aLbSortUser.Enable(); aLbSortUser.SelectEntryPos( rSortData.nUserIndex ); } else { - aBtnSortUser.Check( FALSE ); + aBtnSortUser.Check( false ); aLbSortUser.Disable(); aLbSortUser.SelectEntryPos( 0 ); } @@ -765,7 +772,7 @@ void ScTabPageSortOptions::Reset( const SfxItemSet& /* rArgSet */ ) if ( pDoc && !rSortData.bInplace ) { String aStr; - USHORT nFormat = (rSortData.nDestTab != pViewData->GetTabNo()) + sal_uInt16 nFormat = (rSortData.nDestTab != pViewData->GetTabNo()) ? SCR_ABS_3D : SCR_ABS; @@ -784,7 +791,7 @@ void ScTabPageSortOptions::Reset( const SfxItemSet& /* rArgSet */ ) } else { - aBtnCopyResult.Check( FALSE ); + aBtnCopyResult.Check( false ); aLbOutPos.Disable(); aEdOutPos.Disable(); aEdOutPos.SetText( EMPTY_STRING ); @@ -793,14 +800,14 @@ void ScTabPageSortOptions::Reset( const SfxItemSet& /* rArgSet */ ) // ----------------------------------------------------------------------- -BOOL ScTabPageSortOptions::FillItemSet( SfxItemSet& rArgSet ) +sal_Bool ScTabPageSortOptions::FillItemSet( SfxItemSet& rArgSet ) { ScSortParam theSortData = rSortData; if (pDlg) { const SfxItemSet* pExample = pDlg->GetExampleSet(); const SfxPoolItem* pItem; - if ( pExample && pExample->GetItemState( nWhichSort, TRUE, &pItem ) == SFX_ITEM_SET ) + if ( pExample && pExample->GetItemState( nWhichSort, sal_True, &pItem ) == SFX_ITEM_SET ) theSortData = ((const ScSortItem*)pItem)->GetSortData(); } @@ -828,7 +835,7 @@ BOOL ScTabPageSortOptions::FillItemSet( SfxItemSet& rArgSet ) { uno::Sequence<rtl::OUString> aAlgos = pColWrap->listCollatorAlgorithms( theSortData.aCollatorLocale ); - USHORT nSel = aLbAlgorithm.GetSelectEntryPos(); + sal_uInt16 nSel = aLbAlgorithm.GetSelectEntryPos(); if ( nSel < aAlgos.getLength() ) sAlg = aAlgos[nSel]; } @@ -836,7 +843,7 @@ BOOL ScTabPageSortOptions::FillItemSet( SfxItemSet& rArgSet ) rArgSet.Put( ScSortItem( SCITEM_SORTDATA, &theSortData ) ); - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -867,7 +874,7 @@ void ScTabPageSortOptions::ActivatePage() int ScTabPageSortOptions::DeactivatePage( SfxItemSet* pSetP ) { - BOOL bPosInputOk = TRUE; + sal_Bool bPosInputOk = sal_True; if ( aBtnCopyResult.IsChecked() ) { @@ -885,7 +892,7 @@ int ScTabPageSortOptions::DeactivatePage( SfxItemSet* pSetP ) thePos.SetTab( pViewData->GetTabNo() ); } - USHORT nResult = thePos.Parse( thePosStr, pDoc, pDoc->GetAddressConvention() ); + sal_uInt16 nResult = thePos.Parse( thePosStr, pDoc, pDoc->GetAddressConvention() ); bPosInputOk = ( SCA_VALID == (nResult & SCA_VALID) ); @@ -928,9 +935,9 @@ void ScTabPageSortOptions::FillUserSortListBox() aLbSortUser.Clear(); if ( pUserLists ) { - USHORT nCount = pUserLists->GetCount(); + sal_uInt16 nCount = pUserLists->GetCount(); if ( nCount > 0 ) - for ( USHORT i=0; i<nCount; i++ ) + for ( sal_uInt16 i=0; i<nCount; i++ ) aLbSortUser.InsertEntry( (*pUserLists)[i]->GetString() ); } } @@ -974,7 +981,7 @@ IMPL_LINK( ScTabPageSortOptions, SelOutPosHdl, ListBox *, pLb ) if ( pLb == &aLbOutPos ) { String aString; - USHORT nSelPos = aLbOutPos.GetSelectEntryPos(); + sal_uInt16 nSelPos = aLbOutPos.GetSelectEntryPos(); if ( nSelPos > 0 ) aString = *(String*)aLbOutPos.GetEntryData( nSelPos ); @@ -1006,14 +1013,14 @@ void ScTabPageSortOptions::EdOutPosModHdl( Edit* pEd ) if ( pEd == &aEdOutPos ) { String theCurPosStr = aEdOutPos.GetText(); - USHORT nResult = ScAddress().Parse( theCurPosStr, pDoc, pDoc->GetAddressConvention() ); + sal_uInt16 nResult = ScAddress().Parse( theCurPosStr, pDoc, pDoc->GetAddressConvention() ); if ( SCA_VALID == (nResult & SCA_VALID) ) { String* pStr = NULL; - BOOL bFound = FALSE; - USHORT i = 0; - USHORT nCount = aLbOutPos.GetEntryCount(); + sal_Bool bFound = false; + sal_uInt16 i = 0; + sal_uInt16 nCount = aLbOutPos.GetEntryCount(); for ( i=2; i<nCount && !bFound; i++ ) { @@ -1033,7 +1040,7 @@ void ScTabPageSortOptions::EdOutPosModHdl( Edit* pEd ) IMPL_LINK( ScTabPageSortOptions, FillAlgorHdl, void *, EMPTYARG ) { - aLbAlgorithm.SetUpdateMode( FALSE ); + aLbAlgorithm.SetUpdateMode( false ); aLbAlgorithm.Clear(); LanguageType eLang = aLbLanguage.GetSelectLanguage(); @@ -1042,8 +1049,8 @@ IMPL_LINK( ScTabPageSortOptions, FillAlgorHdl, void *, EMPTYARG ) // for LANGUAGE_SYSTEM no algorithm can be selected because // it wouldn't necessarily exist for other languages // -> leave list box empty if LANGUAGE_SYSTEM is selected - aFtAlgorithm.Enable( FALSE ); // nothing to select - aLbAlgorithm.Enable( FALSE ); // nothing to select + aFtAlgorithm.Enable( false ); // nothing to select + aLbAlgorithm.Enable( false ); // nothing to select } else { @@ -1063,7 +1070,7 @@ IMPL_LINK( ScTabPageSortOptions, FillAlgorHdl, void *, EMPTYARG ) aLbAlgorithm.Enable( nCount > 1 ); // enable only if there is a choice } - aLbAlgorithm.SetUpdateMode( TRUE ); + aLbAlgorithm.SetUpdateMode( sal_True ); return 0; } diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx index abc491618d2e..d27dae46011e 100644 --- a/sc/source/ui/dbgui/tpsubt.cxx +++ b/sc/source/ui/dbgui/tpsubt.cxx @@ -46,7 +46,7 @@ // STATIC DATA ----------------------------------------------------------- -static USHORT pSubTotalsRanges[] = +static sal_uInt16 pSubTotalsRanges[] = { SID_SUBTOTALS, SID_SUBTOTALS, @@ -56,7 +56,7 @@ static USHORT pSubTotalsRanges[] = //======================================================================== // Zwischenergebnisgruppen-Tabpage: -ScTpSubTotalGroup::ScTpSubTotalGroup( Window* pParent, USHORT nResId, +ScTpSubTotalGroup::ScTpSubTotalGroup( Window* pParent, sal_uInt16 nResId, const SfxItemSet& rArgSet ) : SfxTabPage ( pParent, ScResId( nResId ), @@ -91,15 +91,15 @@ ScTpSubTotalGroup::ScTpSubTotalGroup( Window* pParent, USHORT nResId, ScTpSubTotalGroup::~ScTpSubTotalGroup() { - USHORT nCount = (USHORT)aLbColumns.GetEntryCount(); + sal_uInt16 nCount = (sal_uInt16)aLbColumns.GetEntryCount(); if ( nCount > 0 ) { - USHORT* pData = NULL; + sal_uInt16* pData = NULL; - for ( USHORT i=0; i<nCount; i++ ) + for ( sal_uInt16 i=0; i<nCount; i++ ) { - pData = (USHORT*)(aLbColumns.GetEntryData( i )); + pData = (sal_uInt16*)(aLbColumns.GetEntryData( i )); DBG_ASSERT( pData, "EntryData not found" ); delete pData; @@ -130,32 +130,32 @@ void ScTpSubTotalGroup::Init() //------------------------------------------------------------------------ -USHORT* ScTpSubTotalGroup::GetRanges() +sal_uInt16* ScTpSubTotalGroup::GetRanges() { return pSubTotalsRanges; } // ----------------------------------------------------------------------- -BOOL ScTpSubTotalGroup::DoReset( USHORT nGroupNo, +sal_Bool ScTpSubTotalGroup::DoReset( sal_uInt16 nGroupNo, const SfxItemSet& rArgSet ) { - USHORT nGroupIdx = 0; + sal_uInt16 nGroupIdx = 0; DBG_ASSERT( (nGroupNo<=3) && (nGroupNo>0), "Invalid group" ); if ( (nGroupNo > 3) || (nGroupNo == 0) ) - return FALSE; + return false; else nGroupIdx = nGroupNo-1; //---------------------------------------------------------- // first we have to clear the listboxes... - for ( USHORT nLbEntry = 0; nLbEntry < aLbColumns.GetEntryCount(); ++nLbEntry ) + for ( sal_uInt16 nLbEntry = 0; nLbEntry < aLbColumns.GetEntryCount(); ++nLbEntry ) { - aLbColumns.CheckEntryPos( nLbEntry, FALSE ); - *((USHORT*)aLbColumns.GetEntryData( nLbEntry )) = 0; + aLbColumns.CheckEntryPos( nLbEntry, false ); + *((sal_uInt16*)aLbColumns.GetEntryData( nLbEntry )) = 0; } aLbFunctions.SelectEntryPos( 0 ); @@ -172,10 +172,10 @@ BOOL ScTpSubTotalGroup::DoReset( USHORT nGroupNo, aLbGroup.SelectEntryPos( GetFieldSelPos( nField )+1 ); - for ( USHORT i=0; i<nSubTotals; i++ ) + for ( sal_uInt16 i=0; i<nSubTotals; i++ ) { - USHORT nCheckPos = GetFieldSelPos( pSubTotals[i] ); - USHORT* pFunction = (USHORT*)aLbColumns.GetEntryData( nCheckPos ); + sal_uInt16 nCheckPos = GetFieldSelPos( pSubTotals[i] ); + sal_uInt16* pFunction = (sal_uInt16*)aLbColumns.GetEntryData( nCheckPos ); aLbColumns.CheckEntryPos( nCheckPos ); *pFunction = FuncToLbPos( pFunctions[i] ); @@ -189,15 +189,15 @@ BOOL ScTpSubTotalGroup::DoReset( USHORT nGroupNo, aLbFunctions.SelectEntryPos( 0 ); } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- -BOOL ScTpSubTotalGroup::DoFillItemSet( USHORT nGroupNo, +sal_Bool ScTpSubTotalGroup::DoFillItemSet( sal_uInt16 nGroupNo, SfxItemSet& rArgSet ) { - USHORT nGroupIdx = 0; + sal_uInt16 nGroupIdx = 0; DBG_ASSERT( (nGroupNo<=3) && (nGroupNo>0), "Invalid group" ); DBG_ASSERT( (aLbGroup.GetEntryCount() > 0) @@ -211,7 +211,7 @@ BOOL ScTpSubTotalGroup::DoFillItemSet( USHORT nGroupNo, || (aLbColumns.GetEntryCount() == 0) || (aLbFunctions.GetEntryCount() == 0) ) - return FALSE; + return false; else nGroupIdx = nGroupNo-1; @@ -223,15 +223,15 @@ BOOL ScTpSubTotalGroup::DoFillItemSet( USHORT nGroupNo, { const SfxItemSet* pExample = pDlg->GetExampleSet(); const SfxPoolItem* pItem; - if ( pExample && pExample->GetItemState( nWhichSubTotals, TRUE, &pItem ) == SFX_ITEM_SET ) + if ( pExample && pExample->GetItemState( nWhichSubTotals, sal_True, &pItem ) == SFX_ITEM_SET ) theSubTotalData = ((const ScSubTotalItem*)pItem)->GetSubTotalData(); } ScSubTotalFunc* pFunctions = NULL; SCCOL* pSubTotals = NULL; - USHORT nGroup = aLbGroup.GetSelectEntryPos(); - USHORT nEntryCount = (USHORT)aLbColumns.GetEntryCount(); - USHORT nCheckCount = aLbColumns.GetCheckedEntryCount(); + sal_uInt16 nGroup = aLbGroup.GetSelectEntryPos(); + sal_uInt16 nEntryCount = (sal_uInt16)aLbColumns.GetEntryCount(); + sal_uInt16 nCheckCount = aLbColumns.GetCheckedEntryCount(); theSubTotalData.nCol1 = rSubTotalData.nCol1; theSubTotalData.nRow1 = rSubTotalData.nRow1; @@ -244,18 +244,18 @@ BOOL ScTpSubTotalGroup::DoFillItemSet( USHORT nGroupNo, if ( nEntryCount>0 && nCheckCount>0 && nGroup!=0 ) { - USHORT nFunction = 0; + sal_uInt16 nFunction = 0; pSubTotals = new SCCOL [nCheckCount]; pFunctions = new ScSubTotalFunc [nCheckCount]; - for ( USHORT i=0, nCheck=0; i<nEntryCount; i++ ) + for ( sal_uInt16 i=0, nCheck=0; i<nEntryCount; i++ ) { if ( aLbColumns.IsChecked( i ) ) { DBG_ASSERT( nCheck <= nCheckCount, "Range error :-(" ); - nFunction = *((USHORT*)aLbColumns.GetEntryData( i )); + nFunction = *((sal_uInt16*)aLbColumns.GetEntryData( i )); pSubTotals[nCheck] = nFieldArr[i]; pFunctions[nCheck] = LbPosToFunc( nFunction ); nCheck++; @@ -273,7 +273,7 @@ BOOL ScTpSubTotalGroup::DoFillItemSet( USHORT nGroupNo, if ( pSubTotals ) delete [] pSubTotals; if ( pFunctions ) delete [] pFunctions; - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -289,7 +289,7 @@ void ScTpSubTotalGroup::FillListBoxes() SCTAB nTab = pViewData->GetTabNo(); SCCOL nMaxCol = rSubTotalData.nCol2; SCCOL col; - USHORT i=0; + sal_uInt16 i=0; String aFieldName; aLbGroup.Clear(); @@ -309,27 +309,27 @@ void ScTpSubTotalGroup::FillListBoxes() nFieldArr[i] = col; aLbGroup.InsertEntry( aFieldName, i+1 ); aLbColumns.InsertEntry( aFieldName, i ); - aLbColumns.SetEntryData( i, new USHORT(0) ); + aLbColumns.SetEntryData( i, new sal_uInt16(0) ); i++; } // Nachtraegliche "Konstanteninitialisierung": - (USHORT&)nFieldCount = i; + (sal_uInt16&)nFieldCount = i; } } // ----------------------------------------------------------------------- -USHORT ScTpSubTotalGroup::GetFieldSelPos( SCCOL nField ) +sal_uInt16 ScTpSubTotalGroup::GetFieldSelPos( SCCOL nField ) { - USHORT nFieldPos = 0; - BOOL bFound = FALSE; + sal_uInt16 nFieldPos = 0; + sal_Bool bFound = false; - for ( USHORT n=0; n<nFieldCount && !bFound; n++ ) + for ( sal_uInt16 n=0; n<nFieldCount && !bFound; n++ ) { if ( nFieldArr[n] == nField ) { nFieldPos = n; - bFound = TRUE; + bFound = sal_True; } } @@ -338,7 +338,7 @@ USHORT ScTpSubTotalGroup::GetFieldSelPos( SCCOL nField ) // ----------------------------------------------------------------------- -ScSubTotalFunc ScTpSubTotalGroup::LbPosToFunc( USHORT nPos ) +ScSubTotalFunc ScTpSubTotalGroup::LbPosToFunc( sal_uInt16 nPos ) { switch ( nPos ) { @@ -362,7 +362,7 @@ ScSubTotalFunc ScTpSubTotalGroup::LbPosToFunc( USHORT nPos ) // ----------------------------------------------------------------------- -USHORT ScTpSubTotalGroup::FuncToLbPos( ScSubTotalFunc eFunc ) +sal_uInt16 ScTpSubTotalGroup::FuncToLbPos( ScSubTotalFunc eFunc ) { switch ( eFunc ) { @@ -393,9 +393,9 @@ IMPL_LINK( ScTpSubTotalGroup, SelectHdl, ListBox *, pLb ) if ( (aLbColumns.GetEntryCount() > 0) && (aLbColumns.GetSelectionCount() > 0) ) { - USHORT nFunction = aLbFunctions.GetSelectEntryPos(); - USHORT nColumn = aLbColumns.GetSelectEntryPos(); - USHORT* pFunction = (USHORT*)aLbColumns.GetEntryData( nColumn ); + sal_uInt16 nFunction = aLbFunctions.GetSelectEntryPos(); + sal_uInt16 nColumn = aLbColumns.GetSelectEntryPos(); + sal_uInt16* pFunction = (sal_uInt16*)aLbColumns.GetEntryData( nColumn ); DBG_ASSERT( pFunction, "EntryData nicht gefunden!" ); if ( !pFunction ) @@ -408,7 +408,7 @@ IMPL_LINK( ScTpSubTotalGroup, SelectHdl, ListBox *, pLb ) else if ( pLb == &aLbFunctions ) { *pFunction = nFunction; - aLbColumns.CheckEntryPos( nColumn, TRUE ); + aLbColumns.CheckEntryPos( nColumn, true ); } } return 0; @@ -424,7 +424,7 @@ IMPL_LINK( ScTpSubTotalGroup, CheckHdl, ListBox *, pLb ) if ( pEntry ) { - aLbColumns.SelectEntryPos( (USHORT)aLbColumns.GetModel()->GetAbsPos( pEntry ) ); + aLbColumns.SelectEntryPos( (sal_uInt16)aLbColumns.GetModel()->GetAbsPos( pEntry ) ); SelectHdl( pLb ); } } @@ -476,9 +476,9 @@ void ScTpSubTotalGroup3::Reset( const SfxItemSet& rArgSet ) { RESET(3); } // ----------------------------------------------------------------------- #define FILLSET(i) (ScTpSubTotalGroup::DoFillItemSet( (i), rArgSet )) -BOOL ScTpSubTotalGroup1::FillItemSet( SfxItemSet& rArgSet ) { return FILLSET(1); } -BOOL ScTpSubTotalGroup2::FillItemSet( SfxItemSet& rArgSet ) { return FILLSET(2); } -BOOL ScTpSubTotalGroup3::FillItemSet( SfxItemSet& rArgSet ) { return FILLSET(3); } +sal_Bool ScTpSubTotalGroup1::FillItemSet( SfxItemSet& rArgSet ) { return FILLSET(1); } +sal_Bool ScTpSubTotalGroup2::FillItemSet( SfxItemSet& rArgSet ) { return FILLSET(2); } +sal_Bool ScTpSubTotalGroup3::FillItemSet( SfxItemSet& rArgSet ) { return FILLSET(3); } #undef FILL //======================================================================== @@ -509,6 +509,9 @@ ScTpSubTotalOptions::ScTpSubTotalOptions( Window* pParent, { Init(); FreeResource(); + + aLbUserDef.SetAccessibleRelationLabeledBy(&aBtnUserDef); + aLbUserDef.SetAccessibleName(aBtnUserDef.GetText()); } // ----------------------------------------------------------------------- @@ -556,13 +559,13 @@ void ScTpSubTotalOptions::Reset( const SfxItemSet& /* rArgSet */ ) if ( rSubTotalData.bUserDef ) { - aBtnUserDef.Check( TRUE ); + aBtnUserDef.Check( sal_True ); aLbUserDef.Enable(); aLbUserDef.SelectEntryPos( rSubTotalData.nUserIndex ); } else { - aBtnUserDef.Check( FALSE ); + aBtnUserDef.Check( false ); aLbUserDef.Disable(); aLbUserDef.SelectEntryPos( 0 ); } @@ -572,7 +575,7 @@ void ScTpSubTotalOptions::Reset( const SfxItemSet& /* rArgSet */ ) // ----------------------------------------------------------------------- -BOOL ScTpSubTotalOptions::FillItemSet( SfxItemSet& rArgSet ) +sal_Bool ScTpSubTotalOptions::FillItemSet( SfxItemSet& rArgSet ) { ScSubTotalParam theSubTotalData; // auslesen, wenn schon teilweise gefuellt SfxTabDialog* pDlg = GetTabDialog(); @@ -580,12 +583,12 @@ BOOL ScTpSubTotalOptions::FillItemSet( SfxItemSet& rArgSet ) { const SfxItemSet* pExample = pDlg->GetExampleSet(); const SfxPoolItem* pItem; - if ( pExample && pExample->GetItemState( nWhichSubTotals, TRUE, &pItem ) == SFX_ITEM_SET ) + if ( pExample && pExample->GetItemState( nWhichSubTotals, sal_True, &pItem ) == SFX_ITEM_SET ) theSubTotalData = ((const ScSubTotalItem*)pItem)->GetSubTotalData(); } theSubTotalData.bPagebreak = aBtnPagebreak.IsChecked(); - theSubTotalData.bReplace = TRUE; + theSubTotalData.bReplace = sal_True; theSubTotalData.bCaseSens = aBtnCase.IsChecked(); theSubTotalData.bIncludePattern = aBtnFormats.IsChecked(); theSubTotalData.bDoSort = aBtnSort.IsChecked(); @@ -597,7 +600,7 @@ BOOL ScTpSubTotalOptions::FillItemSet( SfxItemSet& rArgSet ) rArgSet.Put( ScSubTotalItem( nWhichSubTotals, &theSubTotalData ) ); - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -609,9 +612,9 @@ void ScTpSubTotalOptions::FillUserSortListBox() aLbUserDef.Clear(); if ( pUserLists ) { - USHORT nCount = pUserLists->GetCount(); + sal_uInt16 nCount = pUserLists->GetCount(); if ( nCount > 0 ) - for ( USHORT i=0; i<nCount; i++ ) + for ( sal_uInt16 i=0; i<nCount; i++ ) aLbUserDef.InsertEntry( (*pUserLists)[i]->GetString() ); } } diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx index e643b3a85e7c..fdfe24ba26e0 100644 --- a/sc/source/ui/dbgui/validate.cxx +++ b/sc/source/ui/dbgui/validate.cxx @@ -60,7 +60,7 @@ // ============================================================================ -static USHORT pValueRanges[] = +static sal_uInt16 pValueRanges[] = { FID_VALID_MODE, FID_VALID_ERRTEXT, FID_VALID_LISTTYPE, FID_VALID_LISTTYPE, @@ -160,7 +160,7 @@ void ScTPValidationValue::RefInputDonePostHdl() } -BOOL ScValidationDlg::Close() +sal_Bool ScValidationDlg::Close() { if( m_bOwnRefHdlr ) if( SfxTabPage* pPage = GetTabPage( TP_VALIDATION_VALUES ) ) @@ -172,7 +172,7 @@ BOOL ScValidationDlg::Close() ScValidationDlg::~ScValidationDlg() { if( m_bOwnRefHdlr ) - RemoveRefDlg( FALSE ); + RemoveRefDlg( false ); } @@ -181,9 +181,9 @@ ScValidationDlg::~ScValidationDlg() namespace { /** Converts the passed ScValidationMode to the position in the list box. */ -USHORT lclGetPosFromValMode( ScValidationMode eValMode ) +sal_uInt16 lclGetPosFromValMode( ScValidationMode eValMode ) { - USHORT nLbPos = SC_VALIDDLG_ALLOW_ANY; + sal_uInt16 nLbPos = SC_VALIDDLG_ALLOW_ANY; switch( eValMode ) { case SC_VALID_ANY: nLbPos = SC_VALIDDLG_ALLOW_ANY; break; @@ -200,7 +200,7 @@ USHORT lclGetPosFromValMode( ScValidationMode eValMode ) } /** Converts the passed list box position to an ScValidationMode. */ -ScValidationMode lclGetValModeFromPos( USHORT nLbPos ) +ScValidationMode lclGetValModeFromPos( sal_uInt16 nLbPos ) { ScValidationMode eValMode = SC_VALID_ANY; switch( nLbPos ) @@ -219,9 +219,9 @@ ScValidationMode lclGetValModeFromPos( USHORT nLbPos ) } /** Converts the passed ScConditionMode to the position in the list box. */ -USHORT lclGetPosFromCondMode( ScConditionMode eCondMode ) +sal_uInt16 lclGetPosFromCondMode( ScConditionMode eCondMode ) { - USHORT nLbPos = SC_VALIDDLG_DATA_EQUAL; + sal_uInt16 nLbPos = SC_VALIDDLG_DATA_EQUAL; switch( eCondMode ) { case SC_COND_NONE: // may occur in old XML files after Excel import @@ -239,7 +239,7 @@ USHORT lclGetPosFromCondMode( ScConditionMode eCondMode ) } /** Converts the passed list box position to an ScConditionMode. */ -ScConditionMode lclGetCondModeFromPos( USHORT nLbPos ) +ScConditionMode lclGetCondModeFromPos( sal_uInt16 nLbPos ) { ScConditionMode eCondMode = SC_COND_EQUAL; switch( nLbPos ) @@ -374,7 +374,7 @@ SfxTabPage* ScTPValidationValue::Create( Window* pParent, const SfxItemSet& rArg return( new ScTPValidationValue( pParent, rArgSet ) ); } -USHORT* ScTPValidationValue::GetRanges() +sal_uInt16* ScTPValidationValue::GetRanges() { return pValueRanges; } @@ -383,38 +383,38 @@ void ScTPValidationValue::Reset( const SfxItemSet& rArgSet ) { const SfxPoolItem* pItem; - USHORT nLbPos = SC_VALIDDLG_ALLOW_ANY; - if( rArgSet.GetItemState( FID_VALID_MODE, TRUE, &pItem ) == SFX_ITEM_SET ) + sal_uInt16 nLbPos = SC_VALIDDLG_ALLOW_ANY; + if( rArgSet.GetItemState( FID_VALID_MODE, sal_True, &pItem ) == SFX_ITEM_SET ) nLbPos = lclGetPosFromValMode( static_cast< ScValidationMode >( static_cast< const SfxAllEnumItem* >( pItem )->GetValue() ) ); maLbAllow.SelectEntryPos( nLbPos ); nLbPos = SC_VALIDDLG_DATA_EQUAL; - if( rArgSet.GetItemState( FID_VALID_CONDMODE, TRUE, &pItem ) == SFX_ITEM_SET ) + if( rArgSet.GetItemState( FID_VALID_CONDMODE, sal_True, &pItem ) == SFX_ITEM_SET ) nLbPos = lclGetPosFromCondMode( static_cast< ScConditionMode >( static_cast< const SfxAllEnumItem* >( pItem )->GetValue() ) ); maLbValue.SelectEntryPos( nLbPos ); // *** check boxes *** - BOOL bCheck = TRUE; - if( rArgSet.GetItemState( FID_VALID_BLANK, TRUE, &pItem ) == SFX_ITEM_SET ) + sal_Bool bCheck = sal_True; + if( rArgSet.GetItemState( FID_VALID_BLANK, sal_True, &pItem ) == SFX_ITEM_SET ) bCheck = static_cast< const SfxBoolItem* >( pItem )->GetValue(); maCbAllow.Check( bCheck ); sal_Int32 nListType = ValidListType::UNSORTED; - if( rArgSet.GetItemState( FID_VALID_LISTTYPE, TRUE, &pItem ) == SFX_ITEM_SET ) + if( rArgSet.GetItemState( FID_VALID_LISTTYPE, sal_True, &pItem ) == SFX_ITEM_SET ) nListType = static_cast< const SfxInt16Item* >( pItem )->GetValue(); maCbShow.Check( nListType != ValidListType::INVISIBLE ); maCbSort.Check( nListType == ValidListType::SORTEDASCENDING ); // *** formulas *** String aFmlaStr; - if ( rArgSet.GetItemState( FID_VALID_VALUE1, TRUE, &pItem ) == SFX_ITEM_SET ) + if ( rArgSet.GetItemState( FID_VALID_VALUE1, sal_True, &pItem ) == SFX_ITEM_SET ) aFmlaStr = static_cast< const SfxStringItem* >( pItem )->GetValue(); SetFirstFormula( aFmlaStr ); aFmlaStr.Erase(); - if ( rArgSet.GetItemState( FID_VALID_VALUE2, TRUE, &pItem ) == SFX_ITEM_SET ) + if ( rArgSet.GetItemState( FID_VALID_VALUE2, sal_True, &pItem ) == SFX_ITEM_SET ) aFmlaStr = static_cast< const SfxStringItem* >( pItem )->GetValue(); SetSecondFormula( aFmlaStr ); @@ -422,21 +422,21 @@ void ScTPValidationValue::Reset( const SfxItemSet& rArgSet ) CheckHdl( NULL ); } -BOOL ScTPValidationValue::FillItemSet( SfxItemSet& rArgSet ) +sal_Bool ScTPValidationValue::FillItemSet( SfxItemSet& rArgSet ) { sal_Int16 nListType = maCbShow.IsChecked() ? (maCbSort.IsChecked() ? ValidListType::SORTEDASCENDING : ValidListType::UNSORTED) : ValidListType::INVISIBLE; - rArgSet.Put( SfxAllEnumItem( FID_VALID_MODE, sal::static_int_cast<USHORT>( + rArgSet.Put( SfxAllEnumItem( FID_VALID_MODE, sal::static_int_cast<sal_uInt16>( lclGetValModeFromPos( maLbAllow.GetSelectEntryPos() ) ) ) ); - rArgSet.Put( SfxAllEnumItem( FID_VALID_CONDMODE, sal::static_int_cast<USHORT>( + rArgSet.Put( SfxAllEnumItem( FID_VALID_CONDMODE, sal::static_int_cast<sal_uInt16>( lclGetCondModeFromPos( maLbValue.GetSelectEntryPos() ) ) ) ); rArgSet.Put( SfxStringItem( FID_VALID_VALUE1, GetFirstFormula() ) ); rArgSet.Put( SfxStringItem( FID_VALID_VALUE2, GetSecondFormula() ) ); rArgSet.Put( SfxBoolItem( FID_VALID_BLANK, maCbAllow.IsChecked() ) ); rArgSet.Put( SfxInt16Item( FID_VALID_LISTTYPE, nListType ) ); - return TRUE; + return sal_True; } String ScTPValidationValue::GetFirstFormula() const @@ -582,7 +582,7 @@ void ScTPValidationValue::TidyListBoxes() IMPL_LINK( ScTPValidationValue, EditSetFocusHdl, Edit *, EMPTYARG) { - USHORT nPos=maLbAllow.GetSelectEntryPos(); + sal_uInt16 nPos=maLbAllow.GetSelectEntryPos(); if ( nPos == SC_VALIDDLG_ALLOW_RANGE ) { @@ -609,7 +609,7 @@ IMPL_LINK( ScTPValidationValue, KillFocusHdl, Window *, pWnd ) IMPL_LINK( ScTPValidationValue, SelectHdl, ListBox*, EMPTYARG ) { - USHORT nLbPos = maLbAllow.GetSelectEntryPos(); + sal_uInt16 nLbPos = maLbAllow.GetSelectEntryPos(); bool bEnable = (nLbPos != SC_VALIDDLG_ALLOW_ANY); bool bRange = (nLbPos == SC_VALIDDLG_ALLOW_RANGE); bool bList = (nLbPos == SC_VALIDDLG_ALLOW_LIST); @@ -701,12 +701,12 @@ ScTPValidationHelp::~ScTPValidationHelp() void ScTPValidationHelp::Init() { - aTsbHelp.EnableTriState( FALSE ); + aTsbHelp.EnableTriState( false ); } //------------------------------------------------------------------------ -USHORT* ScTPValidationHelp::GetRanges() +sal_uInt16* ScTPValidationHelp::GetRanges() { return pValueRanges; } @@ -725,17 +725,17 @@ void ScTPValidationHelp::Reset( const SfxItemSet& rArgSet ) { const SfxPoolItem* pItem; - if ( rArgSet.GetItemState( FID_VALID_SHOWHELP, TRUE, &pItem ) == SFX_ITEM_SET ) + if ( rArgSet.GetItemState( FID_VALID_SHOWHELP, sal_True, &pItem ) == SFX_ITEM_SET ) aTsbHelp.SetState( ((const SfxBoolItem*)pItem)->GetValue() ? STATE_CHECK : STATE_NOCHECK ); else aTsbHelp.SetState( STATE_NOCHECK ); - if ( rArgSet.GetItemState( FID_VALID_HELPTITLE, TRUE, &pItem ) == SFX_ITEM_SET ) + if ( rArgSet.GetItemState( FID_VALID_HELPTITLE, sal_True, &pItem ) == SFX_ITEM_SET ) aEdtTitle.SetText( ((const SfxStringItem*)pItem)->GetValue() ); else aEdtTitle.SetText( EMPTY_STRING ); - if ( rArgSet.GetItemState( FID_VALID_HELPTEXT, TRUE, &pItem ) == SFX_ITEM_SET ) + if ( rArgSet.GetItemState( FID_VALID_HELPTEXT, sal_True, &pItem ) == SFX_ITEM_SET ) aEdInputHelp.SetText( ((const SfxStringItem*)pItem)->GetValue() ); else aEdInputHelp.SetText( EMPTY_STRING ); @@ -743,13 +743,13 @@ void ScTPValidationHelp::Reset( const SfxItemSet& rArgSet ) // ----------------------------------------------------------------------- -BOOL ScTPValidationHelp::FillItemSet( SfxItemSet& rArgSet ) +sal_Bool ScTPValidationHelp::FillItemSet( SfxItemSet& rArgSet ) { rArgSet.Put( SfxBoolItem( FID_VALID_SHOWHELP, aTsbHelp.GetState() == STATE_CHECK ) ); rArgSet.Put( SfxStringItem( FID_VALID_HELPTITLE, aEdtTitle.GetText() ) ); rArgSet.Put( SfxStringItem( FID_VALID_HELPTEXT, aEdInputHelp.GetText() ) ); - return TRUE; + return sal_True; } //======================================================================== @@ -792,14 +792,14 @@ void ScTPValidationError::Init() aBtnSearch.SetClickHdl( LINK( this, ScTPValidationError, ClickSearchHdl ) ); aLbAction.SelectEntryPos( 0 ); - aTsbShow.EnableTriState( FALSE ); + aTsbShow.EnableTriState( false ); SelectActionHdl( NULL ); } //------------------------------------------------------------------------ -USHORT* ScTPValidationError::GetRanges() +sal_uInt16* ScTPValidationError::GetRanges() { return pValueRanges; } @@ -818,22 +818,22 @@ void ScTPValidationError::Reset( const SfxItemSet& rArgSet ) { const SfxPoolItem* pItem; - if ( rArgSet.GetItemState( FID_VALID_SHOWERR, TRUE, &pItem ) == SFX_ITEM_SET ) + if ( rArgSet.GetItemState( FID_VALID_SHOWERR, sal_True, &pItem ) == SFX_ITEM_SET ) aTsbShow.SetState( ((const SfxBoolItem*)pItem)->GetValue() ? STATE_CHECK : STATE_NOCHECK ); else aTsbShow.SetState( STATE_CHECK ); // check by default - if ( rArgSet.GetItemState( FID_VALID_ERRSTYLE, TRUE, &pItem ) == SFX_ITEM_SET ) + if ( rArgSet.GetItemState( FID_VALID_ERRSTYLE, sal_True, &pItem ) == SFX_ITEM_SET ) aLbAction.SelectEntryPos( ((const SfxAllEnumItem*)pItem)->GetValue() ); else aLbAction.SelectEntryPos( 0 ); - if ( rArgSet.GetItemState( FID_VALID_ERRTITLE, TRUE, &pItem ) == SFX_ITEM_SET ) + if ( rArgSet.GetItemState( FID_VALID_ERRTITLE, sal_True, &pItem ) == SFX_ITEM_SET ) aEdtTitle.SetText( ((const SfxStringItem*)pItem)->GetValue() ); else aEdtTitle.SetText( EMPTY_STRING ); - if ( rArgSet.GetItemState( FID_VALID_ERRTEXT, TRUE, &pItem ) == SFX_ITEM_SET ) + if ( rArgSet.GetItemState( FID_VALID_ERRTEXT, sal_True, &pItem ) == SFX_ITEM_SET ) aEdError.SetText( ((const SfxStringItem*)pItem)->GetValue() ); else aEdError.SetText( EMPTY_STRING ); @@ -843,14 +843,14 @@ void ScTPValidationError::Reset( const SfxItemSet& rArgSet ) // ----------------------------------------------------------------------- -BOOL ScTPValidationError::FillItemSet( SfxItemSet& rArgSet ) +sal_Bool ScTPValidationError::FillItemSet( SfxItemSet& rArgSet ) { rArgSet.Put( SfxBoolItem( FID_VALID_SHOWERR, aTsbShow.GetState() == STATE_CHECK ) ); rArgSet.Put( SfxAllEnumItem( FID_VALID_ERRSTYLE, aLbAction.GetSelectEntryPos() ) ); rArgSet.Put( SfxStringItem( FID_VALID_ERRTITLE, aEdtTitle.GetText() ) ); rArgSet.Put( SfxStringItem( FID_VALID_ERRTEXT, aEdError.GetText() ) ); - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -858,7 +858,7 @@ BOOL ScTPValidationError::FillItemSet( SfxItemSet& rArgSet ) IMPL_LINK( ScTPValidationError, SelectActionHdl, ListBox*, EMPTYARG ) { ScValidErrorStyle eStyle = (ScValidErrorStyle) aLbAction.GetSelectEntryPos(); - BOOL bMacro = ( eStyle == SC_VALERR_MACRO ); + sal_Bool bMacro = ( eStyle == SC_VALERR_MACRO ); aBtnSearch.Enable( bMacro ); aFtError.Enable( !bMacro ); @@ -894,13 +894,13 @@ bool ScValidationDlg::EnterRefStatus() if( !pTabViewShell ) return false; - USHORT nId = SLOTID; + sal_uInt16 nId = SLOTID; SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); if ( pWnd && pWnd->GetWindow()!= this ) pWnd = NULL; - SC_MOD()->SetRefDialog( nId, pWnd ? FALSE : TRUE ); + SC_MOD()->SetRefDialog( nId, pWnd ? false : sal_True ); return true; } @@ -911,7 +911,7 @@ bool ScValidationDlg::LeaveRefStatus() if( !pTabViewShell ) return false; - USHORT nId = SLOTID; + sal_uInt16 nId = SLOTID; SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); if ( pViewFrm->GetChildWindow( nId ) ) { @@ -925,14 +925,14 @@ bool ScValidationDlg::SetupRefDlg() if ( m_bOwnRefHdlr ) return false; if( EnterRefMode() ) { - SetModal( FALSE ); + SetModal( false ); return m_bOwnRefHdlr = true && EnterRefStatus(); } return false; } -bool ScValidationDlg::RemoveRefDlg( BOOL bRestoreModal /* = TRUE */ ) +bool ScValidationDlg::RemoveRefDlg( sal_Bool bRestoreModal /* = sal_True */ ) { bool bVisLock = false; bool bFreeWindowLock = false; @@ -953,7 +953,7 @@ bool ScValidationDlg::RemoveRefDlg( BOOL bRestoreModal /* = TRUE */ ) m_bOwnRefHdlr = false; if( bRestoreModal ) - SetModal( TRUE ); + SetModal( sal_True ); } if ( SfxChildWindow* pWnd = pTabVwSh->GetViewFrame()->GetChildWindow( SID_VALIDITY_REFERENCE ) ) @@ -979,14 +979,14 @@ void ScTPValidationValue::OnClick( Button *pBtn ) SetupRefDlg(); } -BOOL ScValidationDlg::IsChildFocus() +sal_Bool ScValidationDlg::IsChildFocus() { if ( const Window *pWin = Application::GetFocusWindow() ) while( NULL != ( pWin = pWin->GetParent() ) ) if( pWin == this ) - return TRUE; + return sal_True; - return FALSE; + return false; } diff --git a/sc/source/ui/dbgui/validate.src b/sc/source/ui/dbgui/validate.src index 0e1ea8403132..62e7f597ca25 100644 --- a/sc/source/ui/dbgui/validate.src +++ b/sc/source/ui/dbgui/validate.src @@ -66,6 +66,7 @@ TabDialog TAB_DLG_VALIDATION TabPage TP_VALIDATION_VALUES { + HelpID = "sc:TabPage:TP_VALIDATION_VALUES"; Hide = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 260 , 185 ) ; @@ -78,6 +79,7 @@ TabPage TP_VALIDATION_VALUES }; ListBox LB_ALLOW { + HelpID = "sc:ListBox:TP_VALIDATION_VALUES:LB_ALLOW"; Border = TRUE ; Pos = MAP_APPFONT ( 80 - OFFSET_X , 14 ) ; Size = MAP_APPFONT ( 90 , 80 ) ; @@ -103,6 +105,7 @@ TabPage TP_VALIDATION_VALUES }; ListBox LB_VALUE { + HelpID = "sc:ListBox:TP_VALIDATION_VALUES:LB_VALUE"; Border = TRUE ; Pos = MAP_APPFONT ( 80 - OFFSET_X , 56 ) ; Size = MAP_APPFONT ( 90 , 90 ) ; @@ -129,6 +132,7 @@ TabPage TP_VALIDATION_VALUES }; Edit EDT_MIN { + HelpID = "sc:Edit:TP_VALIDATION_VALUES:EDT_MIN"; Border = TRUE ; Pos = MAP_APPFONT ( 80 - OFFSET_X , 74 ) ; Size = MAP_APPFONT ( 90 , 12 ) ; @@ -136,6 +140,7 @@ TabPage TP_VALIDATION_VALUES }; MultiLineEdit EDT_LIST { + HelpID = "sc:MultiLineEdit:TP_VALIDATION_VALUES:EDT_LIST"; Border = TRUE ; Pos = MAP_APPFONT ( 80 - OFFSET_X , 74 ) ; Size = MAP_APPFONT ( 174 + OFFSET_X , 105 ) ; @@ -150,6 +155,7 @@ TabPage TP_VALIDATION_VALUES }; Edit EDT_MAX { + HelpID = "sc:Edit:TP_VALIDATION_VALUES:EDT_MAX"; Border = TRUE ; Pos = MAP_APPFONT ( 80 - OFFSET_X , 90 ) ; Size = MAP_APPFONT ( 90 , 12 ) ; @@ -185,6 +191,7 @@ TabPage TP_VALIDATION_VALUES }; ImageButton RB_VALIDITY_REF { + HelpID = "sc:ImageButton:TP_VALIDATION_VALUES:RB_VALIDITY_REF"; Pos = MAP_APPFONT ( 142 , 73 ) ; Size = MAP_APPFONT ( 13 , 14 ) ; TabStop = TRUE ; @@ -194,12 +201,14 @@ TabPage TP_VALIDATION_VALUES TabPage TP_VALIDATION_INPUTHELP { + HelpID = "sc:TabPage:TP_VALIDATION_INPUTHELP"; Hide = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 260 , 185 ) ; Text = "Eingabehilfe" ; TriStateBox TSB_HELP { + HelpID = "sc:TriStateBox:TP_VALIDATION_INPUTHELP:TSB_HELP"; Pos = MAP_APPFONT ( 6 , 6 ) ; Size = MAP_APPFONT ( 248 , 10 ) ; TabStop = TRUE ; @@ -225,6 +234,7 @@ TabPage TP_VALIDATION_INPUTHELP }; Edit EDT_TITLE { + HelpID = "sc:Edit:TP_VALIDATION_INPUTHELP:EDT_TITLE"; Border = TRUE ; Pos = MAP_APPFONT ( 80 , 33 ) ; Size = MAP_APPFONT ( 171 , 12 ) ; @@ -232,6 +242,7 @@ TabPage TP_VALIDATION_INPUTHELP }; MultiLineEdit EDT_INPUTHELP { + HelpID = "sc:MultiLineEdit:TP_VALIDATION_INPUTHELP:EDT_INPUTHELP"; Border = TRUE ; Pos = MAP_APPFONT ( 80 , 51 ) ; Size = MAP_APPFONT ( 171 , 128 ) ; @@ -243,6 +254,7 @@ TabPage TP_VALIDATION_INPUTHELP TabPage TP_VALIDATION_ERROR { + HelpID = "sc:TabPage:TP_VALIDATION_ERROR"; Hide = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 260 , 185 ) ; @@ -254,6 +266,7 @@ TabPage TP_VALIDATION_ERROR }; TriStateBox TSB_SHOW { + HelpID = "sc:TriStateBox:TP_VALIDATION_ERROR:TSB_SHOW"; Pos = MAP_APPFONT ( 6 , 6 ) ; Size = MAP_APPFONT ( 248 , 10 ) ; TabStop = TRUE ; @@ -261,6 +274,7 @@ TabPage TP_VALIDATION_ERROR }; MultiLineEdit EDT_ERROR { + HelpID = "sc:MultiLineEdit:TP_VALIDATION_ERROR:EDT_ERROR"; Border = TRUE ; Pos = MAP_APPFONT ( 80 , 69 ) ; Size = MAP_APPFONT ( 171 , 110 ) ; @@ -270,6 +284,7 @@ TabPage TP_VALIDATION_ERROR }; Edit EDT_TITLE { + HelpID = "sc:Edit:TP_VALIDATION_ERROR:EDT_TITLE"; Border = TRUE ; Pos = MAP_APPFONT ( 80 , 51 ) ; Size = MAP_APPFONT ( 171 , 12 ) ; @@ -295,6 +310,7 @@ TabPage TP_VALIDATION_ERROR }; ListBox LB_ACTION { + HelpID = "sc:ListBox:TP_VALIDATION_ERROR:LB_ACTION"; Border = TRUE ; Pos = MAP_APPFONT ( 80 , 33 ) ; Size = MAP_APPFONT ( 107 , 76 ) ; @@ -311,6 +327,7 @@ TabPage TP_VALIDATION_ERROR }; PushButton BTN_SEARCH { + HelpID = "sc:PushButton:TP_VALIDATION_ERROR:BTN_SEARCH"; Pos = MAP_APPFONT ( 191 , 32 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; TabStop = TRUE ; |