This is an automated email from the ASF dual-hosted git repository. mseidel pushed a commit to branch AOO42X in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit f13e928a79f818254741744fc7aa1cf817a4969c Author: mseidel <[email protected]> AuthorDate: Sat May 10 22:51:12 2025 +0200 Cleanup (cherry picked from commit ed731925fa661db5da30a05a91c0ce7f67d40eed) --- main/autodoc/source/parser_i/idl/unoidl.cxx | 98 ++++++++-------- main/basic/source/runtime/sbdiagnose.cxx | 126 ++++++++++---------- .../controller/main/StatusBarCommandDispatch.cxx | 130 ++++++++++----------- main/dbaccess/source/ui/misc/moduledbu.cxx | 30 +++-- .../win32/source/odbcconfig/odbcconfig.cxx | 114 +++++++++--------- main/formula/source/ui/resource/ModuleHelper.cxx | 29 +++-- main/oox/source/xls/themebuffer.cxx | 106 ++++++++--------- main/reportdesign/source/core/sdr/ModuleHelper.cxx | 29 +++-- 8 files changed, 328 insertions(+), 334 deletions(-) diff --git a/main/autodoc/source/parser_i/idl/unoidl.cxx b/main/autodoc/source/parser_i/idl/unoidl.cxx index 137d150653..993bc2aeef 100644 --- a/main/autodoc/source/parser_i/idl/unoidl.cxx +++ b/main/autodoc/source/parser_i/idl/unoidl.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,22 +7,21 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ #include <precomp.h> #include <parser/unoidl.hxx> - // NOT FULLY DECLARED SERVICES #include <stdlib.h> #include <cosv/file.hxx> @@ -40,36 +39,33 @@ #include <adc_msg.hxx> #include <x_parse2.hxx> - - namespace autodoc { - class FileParsePerformers { public: FileParsePerformers( - ary::Repository & - io_rRepository, - ParserInfo & io_rParserInfo ); + ary::Repository & + io_rRepository, + ParserInfo & io_rParserInfo ); void ParseFile( const char * i_sFullPath ); - void ConnectLinks(); + void ConnectLinks(); private: CharacterSource aFileLoader; Dyn<csi::uidl::TokenParser_Uidl> pTokens; csi::uidl::TokenDistributor - aDistributor; + aDistributor; Dyn<csi::uidl::PE_File> - pFileParseEnvironment; + pFileParseEnvironment; ary::Repository & - rRepository; - ParserInfo & rParserInfo; + rRepository; + ParserInfo & rParserInfo; }; @@ -83,7 +79,7 @@ IdlParser::Run( const autodoc::FileCollector_Ifc & i_rFiles ) { Dyn<FileParsePerformers> pFileParsePerformers( - new FileParsePerformers(*pRepository, + new FileParsePerformers(*pRepository, static_cast< ParserInfo& >(*this)) ); FileCollector::const_iterator iEnd = i_rFiles.End(); @@ -93,45 +89,45 @@ IdlParser::Run( const autodoc::FileCollector_Ifc & i_rFiles ) { Cout() << (*iter) << " ..."<< Endl(); - try - { - pFileParsePerformers->ParseFile(*iter); - } - catch (X_AutodocParser &) - { - /// Ignore and goon - TheMessages().Out_ParseError(CurFile(), CurLine()); - pFileParsePerformers - = new FileParsePerformers(*pRepository, - static_cast< ParserInfo& >(*this)); - } - catch (X_Docu & xd) - { - // Currently thic catches only wrong since tags, while since tags are - // transformed. In this case the program shall be terminated. - Cerr() << xd << Endl(); - exit(1); - } - catch (...) - { - Cout() << "Unknown error." << Endl(); - exit(0); -// pFileParsePerformers = new FileParsePerformers( *pRepository ); - } + try + { + pFileParsePerformers->ParseFile(*iter); + } + catch (X_AutodocParser &) + { + // Ignore and go on + TheMessages().Out_ParseError(CurFile(), CurLine()); + pFileParsePerformers + = new FileParsePerformers(*pRepository, + static_cast< ParserInfo& >(*this)); + } + catch (X_Docu & xd) + { + // Currently this catches only wrong since tags, while since tags are + // transformed. In this case the program shall be terminated. + Cerr() << xd << Endl(); + exit(1); + } + catch (...) + { + Cout() << "Unknown error." << Endl(); + exit(0); +// pFileParsePerformers = new FileParsePerformers( *pRepository ); + } } - pFileParsePerformers->ConnectLinks(); + pFileParsePerformers->ConnectLinks(); } FileParsePerformers::FileParsePerformers( ary::Repository & io_rRepository, ParserInfo & io_rParserInfo ) : pTokens(0), - aDistributor(io_rRepository, io_rParserInfo), + aDistributor(io_rRepository, io_rParserInfo), rRepository( io_rRepository ), rParserInfo(io_rParserInfo) { DYN csi::dsapi::Context_Docu * - dpDocuContext + dpDocuContext = new csi::dsapi::Context_Docu( aDistributor.DocuTokens_Receiver() ); pTokens = new csi::uidl::TokenParser_Uidl( aDistributor.CodeTokens_Receiver(), *dpDocuContext ); pFileParseEnvironment @@ -151,9 +147,9 @@ FileParsePerformers::ParseFile( const char * i_sFullPath ) aFileLoader.LoadText(aFile); aFile.close(); - rParserInfo.Set_CurFile(i_sFullPath, true); // true = count lines + rParserInfo.Set_CurFile(i_sFullPath, true); // true = count lines pTokens->Start(aFileLoader); - aDistributor.Reset(); + aDistributor.Reset(); do { aDistributor.TradeToken(); @@ -163,8 +159,10 @@ FileParsePerformers::ParseFile( const char * i_sFullPath ) void FileParsePerformers::ConnectLinks() { - // KORR_FUTURE ? -// rRepository.RwGate_Idl().ConnectAdditionalLinks(); +// KORR_FUTURE ? +// rRepository.RwGate_Idl().ConnectAdditionalLinks(); } -} // namespace autodoc +} // namespace autodoc + +/* vim: set noet sw=4 ts=4: */ diff --git a/main/basic/source/runtime/sbdiagnose.cxx b/main/basic/source/runtime/sbdiagnose.cxx index 411be587c6..ebaa914f97 100644 --- a/main/basic/source/runtime/sbdiagnose.cxx +++ b/main/basic/source/runtime/sbdiagnose.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,20 +7,18 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ - - #include "precompiled_basic.hxx" #include "rtlproto.hxx" @@ -45,43 +43,43 @@ void ResetCapturedAssertions() { DBG_INSTOUTERROR( nRestoreChannelId ); } - nRestoreChannelId = 0; - xAssertionChannelBasic = NULL; - sCaptureFunctionName = String(); - bReportingAssertion = false; + nRestoreChannelId = 0; + xAssertionChannelBasic = NULL; + sCaptureFunctionName = String(); + bReportingAssertion = false; } void DbgReportAssertion( const sal_Char* i_assertionMessage ) { - if ( !xAssertionChannelBasic ) - { - ResetCapturedAssertions(); - return; - } + if ( !xAssertionChannelBasic ) + { + ResetCapturedAssertions(); + return; + } - // prevent infinite recursion - if ( bReportingAssertion ) - return; - ::comphelper::FlagRestorationGuard aGuard( bReportingAssertion, true ); + // prevent infinite recursion + if ( bReportingAssertion ) + return; + ::comphelper::FlagRestorationGuard aGuard( bReportingAssertion, true ); SbxArrayRef const xArguments( new SbxArray( SbxVARIANT ) ); SbxVariableRef const xMessageText = new SbxVariable( SbxSTRING ); - xMessageText->PutString( String::CreateFromAscii( i_assertionMessage ) ); - xArguments->Put( xMessageText, 1 ); + xMessageText->PutString( String::CreateFromAscii( i_assertionMessage ) ); + xArguments->Put( xMessageText, 1 ); - ErrCode const nError = xAssertionChannelBasic->Call( sCaptureFunctionName, xArguments ); - if ( ( nError & SbERR_METHOD_NOT_FOUND ) != 0 ) - ResetCapturedAssertions(); + ErrCode const nError = xAssertionChannelBasic->Call( sCaptureFunctionName, xArguments ); + if ( ( nError & SbERR_METHOD_NOT_FOUND ) != 0 ) + ResetCapturedAssertions(); } #endif -/// capture assertions, route them to the given given Basic function +// capture assertions, route them to the given given Basic function RTLFUNC(CaptureAssertions) { - (void)bWrite; + (void)bWrite; - // need exactly one argument + // need exactly one argument if ( rPar.Count() != 2 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -89,42 +87,44 @@ RTLFUNC(CaptureAssertions) } #ifdef DBG_UTIL - DBG_TESTSOLARMUTEX(); - - String const sFunctionName = rPar.Get(1)->GetString(); - if ( sFunctionName.Len() == 0 ) - { - ResetCapturedAssertions(); - return; - } - - if ( nAssertionChannelId == 0 ) - { - // TODO: should we register a named channel at the VCL API, instead of an unnamed channel at the tools API? - // A named channel would mean it would appear in the nonpro-debug-options dialog - nAssertionChannelId = DbgRegisterUserChannel( &DbgReportAssertion ); - } - - DbgChannelId const nCurrentChannelId = (DbgChannelId)DbgGetErrorOut(); - if ( nCurrentChannelId != nAssertionChannelId ) - { - // remember the current channel - nRestoreChannelId = nCurrentChannelId; - - // set the new channel - DBG_INSTOUTERROR( nAssertionChannelId ); - - // ensure OSL assertions are captured, too - DbgData aData( *DbgGetData() ); - aData.bHookOSLAssert = sal_True; - DbgUpdateOslHook( &aData ); - } - - xAssertionChannelBasic = pBasic; - sCaptureFunctionName = sFunctionName; + DBG_TESTSOLARMUTEX(); + + String const sFunctionName = rPar.Get(1)->GetString(); + if ( sFunctionName.Len() == 0 ) + { + ResetCapturedAssertions(); + return; + } + + if ( nAssertionChannelId == 0 ) + { + // TODO: should we register a named channel at the VCL API, instead of an unnamed channel at the tools API? + // A named channel would mean it would appear in the nonpro-debug-options dialog + nAssertionChannelId = DbgRegisterUserChannel( &DbgReportAssertion ); + } + + DbgChannelId const nCurrentChannelId = (DbgChannelId)DbgGetErrorOut(); + if ( nCurrentChannelId != nAssertionChannelId ) + { + // remember the current channel + nRestoreChannelId = nCurrentChannelId; + + // set the new channel + DBG_INSTOUTERROR( nAssertionChannelId ); + + // ensure OSL assertions are captured, too + DbgData aData( *DbgGetData() ); + aData.bHookOSLAssert = sal_True; + DbgUpdateOslHook( &aData ); + } + + xAssertionChannelBasic = pBasic; + sCaptureFunctionName = sFunctionName; #else - (void)pBasic; - (void)rPar; - (void)bWrite; + (void)pBasic; + (void)rPar; + (void)bWrite; #endif } + +/* vim: set noet sw=4 ts=4: */ diff --git a/main/chart2/source/controller/main/StatusBarCommandDispatch.cxx b/main/chart2/source/controller/main/StatusBarCommandDispatch.cxx index 387fa73686..6411fc3e6a 100644 --- a/main/chart2/source/controller/main/StatusBarCommandDispatch.cxx +++ b/main/chart2/source/controller/main/StatusBarCommandDispatch.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,20 +7,18 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_chart2.hxx" @@ -48,13 +46,13 @@ namespace chart { StatusBarCommandDispatch::StatusBarCommandDispatch( - const Reference< uno::XComponentContext > & xContext, - const Reference< frame::XModel > & xModel, - const Reference< view::XSelectionSupplier > & xSelSupp ) : - impl::StatusBarCommandDispatch_Base( xContext ), - m_xModifiable( xModel, uno::UNO_QUERY ), - m_xSelectionSupplier( xSelSupp ), - m_bIsModified( false ) + const Reference< uno::XComponentContext > & xContext, + const Reference< frame::XModel > & xModel, + const Reference< view::XSelectionSupplier > & xSelSupp ) : + impl::StatusBarCommandDispatch_Base( xContext ), + m_xModifiable( xModel, uno::UNO_QUERY ), + m_xSelectionSupplier( xSelSupp ), + m_bIsModified( false ) {} StatusBarCommandDispatch::~StatusBarCommandDispatch() @@ -62,88 +60,90 @@ StatusBarCommandDispatch::~StatusBarCommandDispatch() void StatusBarCommandDispatch::initialize() { - if( m_xModifiable.is()) - { - Reference< util::XModifyBroadcaster > xModifyBroadcaster( m_xModifiable, uno::UNO_QUERY ); - OSL_ASSERT( xModifyBroadcaster.is()); - if( xModifyBroadcaster.is()) - xModifyBroadcaster->addModifyListener( this ); - } - - if( m_xSelectionSupplier.is()) - { - m_xSelectionSupplier->addSelectionChangeListener( this ); - } + if( m_xModifiable.is()) + { + Reference< util::XModifyBroadcaster > xModifyBroadcaster( m_xModifiable, uno::UNO_QUERY ); + OSL_ASSERT( xModifyBroadcaster.is()); + if( xModifyBroadcaster.is()) + xModifyBroadcaster->addModifyListener( this ); + } + + if( m_xSelectionSupplier.is()) + { + m_xSelectionSupplier->addSelectionChangeListener( this ); + } } void StatusBarCommandDispatch::fireStatusEvent( - const OUString & rURL, - const Reference< frame::XStatusListener > & xSingleListener /* = 0 */ ) + const OUString & rURL, + const Reference< frame::XStatusListener > & xSingleListener /* = 0 */ ) { - bool bFireAll( rURL.isEmpty() ); - bool bFireContext( bFireAll || rURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(".uno:Context"))); - bool bFireModified( bFireAll || rURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(".uno:ModifiedStatus"))); - - if( bFireContext ) - { - uno::Any aArg; - Reference< chart2::XChartDocument > xDoc( m_xModifiable, uno::UNO_QUERY ); - aArg <<= ObjectNameProvider::getSelectedObjectText( m_aSelectedOID.getObjectCID(), xDoc ); - fireStatusEventForURL( C2U(".uno:Context"), aArg, true, xSingleListener ); - } - if( bFireModified ) - { - uno::Any aArg; - if( m_bIsModified ) - aArg <<= C2U("*"); - fireStatusEventForURL( C2U(".uno:ModifiedStatus"), aArg, true, xSingleListener ); - } + bool bFireAll( rURL.isEmpty() ); + bool bFireContext( bFireAll || rURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(".uno:Context"))); + bool bFireModified( bFireAll || rURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(".uno:ModifiedStatus"))); + + if( bFireContext ) + { + uno::Any aArg; + Reference< chart2::XChartDocument > xDoc( m_xModifiable, uno::UNO_QUERY ); + aArg <<= ObjectNameProvider::getSelectedObjectText( m_aSelectedOID.getObjectCID(), xDoc ); + fireStatusEventForURL( C2U(".uno:Context"), aArg, true, xSingleListener ); + } + if( bFireModified ) + { + uno::Any aArg; + if( m_bIsModified ) + aArg <<= C2U("*"); + fireStatusEventForURL( C2U(".uno:ModifiedStatus"), aArg, true, xSingleListener ); + } } // ____ XDispatch ____ void SAL_CALL StatusBarCommandDispatch::dispatch( - const util::URL& /* URL */, - const Sequence< beans::PropertyValue >& /* Arguments */ ) - throw (uno::RuntimeException) + const util::URL& /* URL */, + const Sequence< beans::PropertyValue >& /* Arguments */ ) + throw (uno::RuntimeException) { - // nothing to do here + // nothing to do here } // ____ WeakComponentImplHelperBase ____ -/// is called when this is disposed +// is called when this is disposed void SAL_CALL StatusBarCommandDispatch::disposing() { - m_xModifiable.clear(); - m_xSelectionSupplier.clear(); + m_xModifiable.clear(); + m_xSelectionSupplier.clear(); } // ____ XEventListener (base of XModifyListener) ____ void SAL_CALL StatusBarCommandDispatch::disposing( const lang::EventObject& /* Source */ ) - throw (uno::RuntimeException) + throw (uno::RuntimeException) { - m_xModifiable.clear(); - m_xSelectionSupplier.clear(); + m_xModifiable.clear(); + m_xSelectionSupplier.clear(); } // ____ XModifyListener ____ void SAL_CALL StatusBarCommandDispatch::modified( const lang::EventObject& aEvent ) - throw (uno::RuntimeException) + throw (uno::RuntimeException) { - if( m_xModifiable.is()) - m_bIsModified = m_xModifiable->isModified(); + if( m_xModifiable.is()) + m_bIsModified = m_xModifiable->isModified(); - CommandDispatch::modified( aEvent ); + CommandDispatch::modified( aEvent ); } // ____ XSelectionChangeListener ____ void SAL_CALL StatusBarCommandDispatch::selectionChanged( const lang::EventObject& /* aEvent */ ) - throw (uno::RuntimeException) + throw (uno::RuntimeException) { - if( m_xSelectionSupplier.is()) - m_aSelectedOID = ObjectIdentifier( m_xSelectionSupplier->getSelection() ); - else - m_aSelectedOID = ObjectIdentifier(); - fireAllStatusEvents( 0 ); + if( m_xSelectionSupplier.is()) + m_aSelectedOID = ObjectIdentifier( m_xSelectionSupplier->getSelection() ); + else + m_aSelectedOID = ObjectIdentifier(); + fireAllStatusEvents( 0 ); } } // namespace chart + +/* vim: set noet sw=4 ts=4: */ diff --git a/main/dbaccess/source/ui/misc/moduledbu.cxx b/main/dbaccess/source/ui/misc/moduledbu.cxx index b2cb86804a..370e1911c3 100644 --- a/main/dbaccess/source/ui/misc/moduledbu.cxx +++ b/main/dbaccess/source/ui/misc/moduledbu.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,20 +7,18 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbui.hxx" @@ -41,7 +39,7 @@ #define ENTER_MOD_METHOD() \ ::osl::MutexGuard aGuard(s_aMutex); \ ensureImpl() - + //......................................................................... namespace dbaui { @@ -50,18 +48,18 @@ namespace dbaui //========================================================================= //= OModuleImpl //========================================================================= -/** implementation for <type>OModule</type>. not threadsafe, has to be guarded by it's owner +/** implementation for <type>OModule</type>. not threadsafe, has to be guarded by its owner */ class OModuleImpl { ResMgr* m_pRessources; public: - /// ctor + // ctor OModuleImpl(); ~OModuleImpl(); - /// get the manager for the resources of the module + // get the manager for the resources of the module ResMgr* getResManager(); }; @@ -70,7 +68,7 @@ DBG_NAME(OModuleImpl) OModuleImpl::OModuleImpl() :m_pRessources(NULL) { - DBG_CTOR(OModuleImpl,NULL); + DBG_CTOR(OModuleImpl,NULL); } @@ -80,13 +78,13 @@ OModuleImpl::~OModuleImpl() if (m_pRessources) delete m_pRessources; - DBG_DTOR(OModuleImpl,NULL); + DBG_DTOR(OModuleImpl,NULL); } //------------------------------------------------------------------------- ResMgr* OModuleImpl::getResManager() { - // note that this method is not threadsafe, which counts for the whole class ! + // note that this method is not threadsafe, which counts for the whole class! if (!m_pRessources) { @@ -136,6 +134,6 @@ void OModule::ensureImpl() s_pImpl = new OModuleImpl(); } -//......................................................................... -} // namespace dbaui -//......................................................................... +} // namespace dbaui + +/* vim: set noet sw=4 ts=4: */ diff --git a/main/dbaccess/win32/source/odbcconfig/odbcconfig.cxx b/main/dbaccess/win32/source/odbcconfig/odbcconfig.cxx index 21e8df5382..02953210b5 100644 --- a/main/dbaccess/win32/source/odbcconfig/odbcconfig.cxx +++ b/main/dbaccess/win32/source/odbcconfig/odbcconfig.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,20 +7,18 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" @@ -74,50 +72,50 @@ int displayLastError() // Free the buffer. LocalFree( lpMsgBuf ); - return dwError; + return dwError; } /** registers the window class for our application's main window */ BOOL registerWindowClass( HINSTANCE _hAppInstance ) { - WNDCLASSEX wcx; - - wcx.cbSize = sizeof(wcx); // size of structure - wcx.style = CS_HREDRAW | CS_VREDRAW; // redraw if size changes - wcx.lpfnWndProc = DefWindowProc; // points to window procedure - wcx.cbClsExtra = 0; // no extra class memory - wcx.cbWndExtra = 0; // no extra window memory - wcx.hInstance = _hAppInstance; // handle to instance - wcx.hIcon = NULL; // predefined app. icon - wcx.hCursor = NULL; // predefined arrow - wcx.hbrBackground = NULL; // no background brush - wcx.lpszMenuName = NULL; // name of menu resource - wcx.lpszClassName = L"ODBCConfigMainClass"; // name of window class - wcx.hIconSm = NULL; // small class icon - - return ( NULL != RegisterClassEx( &wcx ) ); + WNDCLASSEX wcx; + + wcx.cbSize = sizeof(wcx); // size of structure + wcx.style = CS_HREDRAW | CS_VREDRAW; // redraw if size changes + wcx.lpfnWndProc = DefWindowProc; // points to window procedure + wcx.cbClsExtra = 0; // no extra class memory + wcx.cbWndExtra = 0; // no extra window memory + wcx.hInstance = _hAppInstance; // handle to instance + wcx.hIcon = NULL; // predefined app. icon + wcx.hCursor = NULL; // predefined arrow + wcx.hbrBackground = NULL; // no background brush + wcx.lpszMenuName = NULL; // name of menu resource + wcx.lpszClassName = L"ODBCConfigMainClass"; // name of window class + wcx.hIconSm = NULL; // small class icon + + return ( NULL != RegisterClassEx( &wcx ) ); } -/// initializes the application instances +// initializes the application instances HWND initInstance( HINSTANCE _hAppInstance ) { - HWND hWindow = CreateWindow( - L"ODBCConfigMainClass", // name of window class - L"ODBC Config Wrapper", // title-bar string - WS_OVERLAPPEDWINDOW, // top-level window - CW_USEDEFAULT, // default horizontal position - CW_USEDEFAULT, // default vertical position - CW_USEDEFAULT, // default width - CW_USEDEFAULT, // default height - (HWND) NULL, // no owner window - (HMENU) NULL, // use class menu - _hAppInstance, // handle to application instance - (LPVOID) NULL); // no window-creation data - - // don't show the window, we only need it as parent handle for the - // SQLManageDataSources function - return hWindow; + HWND hWindow = CreateWindow( + L"ODBCConfigMainClass", // name of window class + L"ODBC Config Wrapper", // title-bar string + WS_OVERLAPPEDWINDOW, // top-level window + CW_USEDEFAULT, // default horizontal position + CW_USEDEFAULT, // default vertical position + CW_USEDEFAULT, // default width + CW_USEDEFAULT, // default height + (HWND) NULL, // no owner window + (HMENU) NULL, // use class menu + _hAppInstance, // handle to application instance + (LPVOID) NULL); // no window-creation data + + // Don't show the window, we only need it as parent handle for the + // SQLManageDataSources function + return hWindow; } // main window function @@ -127,28 +125,30 @@ extern "C" int APIENTRY WinMain( HINSTANCE _hAppInstance, HINSTANCE, LPSTR, int extern "C" int APIENTRY _tWinMain( HINSTANCE _hAppInstance, HINSTANCE, LPTSTR, int ) #endif { - if ( !registerWindowClass( _hAppInstance ) ) - return FALSE; + if ( !registerWindowClass( _hAppInstance ) ) + return FALSE; - HWND hAppWindow = initInstance( _hAppInstance ); - if ( !IsWindow( hAppWindow ) ) - return displayLastError(); + HWND hAppWindow = initInstance( _hAppInstance ); + if ( !IsWindow( hAppWindow ) ) + return displayLastError(); - HMODULE hModule = LoadLibraryW( ODBC_UI_LIB_NAME ); - if ( hModule == NULL ) - hModule = LoadLibraryExW( ODBC_UI_LIB_NAME, NULL, LOAD_WITH_ALTERED_SEARCH_PATH ); - if ( hModule == NULL ) - return displayLastError(); + HMODULE hModule = LoadLibraryW( ODBC_UI_LIB_NAME ); + if ( hModule == NULL ) + hModule = LoadLibraryExW( ODBC_UI_LIB_NAME, NULL, LOAD_WITH_ALTERED_SEARCH_PATH ); + if ( hModule == NULL ) + return displayLastError(); - FARPROC pManageDSProc = GetProcAddress( hModule, "SQLManageDataSources" ); - if ( pManageDSProc == NULL ) - return displayLastError(); + FARPROC pManageDSProc = GetProcAddress( hModule, "SQLManageDataSources" ); + if ( pManageDSProc == NULL ) + return displayLastError(); - TSQLManageDataSource pManageDS = (TSQLManageDataSource)pManageDSProc; - if ( !( (*pManageDS)( hAppWindow ) ) ) - return displayLastError(); + TSQLManageDataSource pManageDS = (TSQLManageDataSource)pManageDSProc; + if ( !( (*pManageDS)( hAppWindow ) ) ) + return displayLastError(); - FreeLibrary( hModule ); + FreeLibrary( hModule ); return 0; } + +/* vim: set noet sw=4 ts=4: */ diff --git a/main/formula/source/ui/resource/ModuleHelper.cxx b/main/formula/source/ui/resource/ModuleHelper.cxx index 903cedf711..381f49473c 100644 --- a/main/formula/source/ui/resource/ModuleHelper.cxx +++ b/main/formula/source/ui/resource/ModuleHelper.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,19 +7,18 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ - #include "precompiled_formula.hxx" #include "ModuleHelper.hxx" #include <comphelper/configurationhelper.hxx> @@ -43,22 +42,22 @@ namespace formula { //......................................................................... - using namespace ::com::sun::star; + using namespace ::com::sun::star; //========================================================================= //= OModuleImpl //========================================================================= -/** implementation for <type>OModule</type>. not threadsafe, has to be guarded by it's owner +/** implementation for <type>OModule</type>. not threadsafe, has to be guarded by its owner */ class OModuleImpl { ResMgr* m_pRessources; public: - /// ctor + // ctor OModuleImpl(); ~OModuleImpl(); - /// get the manager for the resources of the module + // get the manager for the resources of the module ResMgr* getResManager(); }; @@ -67,7 +66,7 @@ DBG_NAME( rpt_OModuleImpl ) OModuleImpl::OModuleImpl() :m_pRessources(NULL) { - DBG_CTOR( rpt_OModuleImpl,NULL); + DBG_CTOR( rpt_OModuleImpl,NULL); } @@ -77,13 +76,13 @@ OModuleImpl::~OModuleImpl() if (m_pRessources) delete m_pRessources; - DBG_DTOR( rpt_OModuleImpl,NULL); + DBG_DTOR( rpt_OModuleImpl,NULL); } //------------------------------------------------------------------------- ResMgr* OModuleImpl::getResManager() { - // note that this method is not threadsafe, which counts for the whole class ! + // note that this method is not threadsafe, which counts for the whole class! if (!m_pRessources) { @@ -132,6 +131,6 @@ void OModule::ensureImpl() s_pImpl = new OModuleImpl(); } -//......................................................................... -} // namespace formula -//......................................................................... +} // namespace formula + +/* vim: set noet sw=4 ts=4: */ diff --git a/main/oox/source/xls/themebuffer.cxx b/main/oox/source/xls/themebuffer.cxx index 1b0c7c6390..d1c15ce360 100644 --- a/main/oox/source/xls/themebuffer.cxx +++ b/main/oox/source/xls/themebuffer.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,20 +7,18 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ - - #include "oox/xls/themebuffer.hxx" #include "oox/xls/stylesbuffer.hxx" @@ -39,9 +37,9 @@ namespace { /** Specifies default theme fonts for a specific locale. */ struct BuiltinThemeFont { - const sal_Char* mpcLocale; /// The locale for this font setting. - const sal_Char* mpcHeadFont; /// Default heading font. - const sal_Char* mpcBodyFont; /// Default body font. + const sal_Char* mpcLocale; // The locale for this font setting. + const sal_Char* mpcHeadFont; // Default heading font. + const sal_Char* mpcBodyFont; // Default body font. }; #define FONT_JA "\357\274\255\357\274\263 \357\274\260\343\202\264\343\202\267\343\203\203\343\202\257" @@ -51,32 +49,32 @@ struct BuiltinThemeFont static const BuiltinThemeFont spBuiltinThemeFonts[] = { // locale headings font body font - { "*", "Cambria", "Calibri" }, // Default - { "ar", "Times New Roman", "Arial" }, // Arabic - { "bn", "Vrinda", "Vrinda" }, // Bengali - { "div", "MV Boli", "MV Boli" }, // Divehi - { "fa", "Times New Roman", "Arial" }, // Farsi - { "gu", "Shruti", "Shruti" }, // Gujarati - { "he", "Times New Roman", "Arial" }, // Hebrew - { "hi", "Mangal", "Mangal" }, // Hindi - { "ja", FONT_JA, FONT_JA }, // Japanese - { "kn", "Tunga", "Tunga" }, // Kannada - { "ko", FONT_KO, FONT_KO }, // Korean - { "kok", "Mangal", "Mangal" }, // Konkani - { "ml", "Kartika", "Kartika" }, // Malayalam - { "mr", "Mangal", "Mangal" }, // Marathi - { "pa", "Raavi", "Raavi" }, // Punjabi - { "sa", "Mangal", "Mangal" }, // Sanskrit - { "syr", "Estrangelo Edessa", "Estrangelo Edessa" }, // Syriac - { "ta", "Latha", "Latha" }, // Tamil - { "te", "Gautami", "Gautami" }, // Telugu - { "th", "Tahoma", "Tahoma" }, // Thai - { "ur", "Times New Roman", "Arial" }, // Urdu - { "vi", "Times New Roman", "Arial" }, // Vietnamese - { "zh", FONT_CS, FONT_CS }, // Chinese, Simplified - { "zh-HK", FONT_CT, FONT_CT }, // Chinese, Hong Kong - { "zh-MO", FONT_CT, FONT_CT }, // Chinese, Macau - { "zh-TW", FONT_CT, FONT_CT } // Chinese, Taiwan + { "*", "Cambria", "Calibri" }, // Default + { "ar", "Times New Roman", "Arial" }, // Arabic + { "bn", "Vrinda", "Vrinda" }, // Bengali + { "div", "MV Boli", "MV Boli" }, // Divehi + { "fa", "Times New Roman", "Arial" }, // Farsi + { "gu", "Shruti", "Shruti" }, // Gujarati + { "he", "Times New Roman", "Arial" }, // Hebrew + { "hi", "Mangal", "Mangal" }, // Hindi + { "ja", FONT_JA, FONT_JA }, // Japanese + { "kn", "Tunga", "Tunga" }, // Kannada + { "ko", FONT_KO, FONT_KO }, // Korean + { "kok", "Mangal", "Mangal" }, // Konkani + { "ml", "Kartika", "Kartika" }, // Malayalam + { "mr", "Mangal", "Mangal" }, // Marathi + { "pa", "Raavi", "Raavi" }, // Punjabi + { "sa", "Mangal", "Mangal" }, // Sanskrit + { "syr", "Estrangelo Edessa", "Estrangelo Edessa" }, // Syriac + { "ta", "Latha", "Latha" }, // Tamil + { "te", "Gautami", "Gautami" }, // Telugu + { "th", "Tahoma", "Tahoma" }, // Thai + { "ur", "Times New Roman", "Arial" }, // Urdu + { "vi", "Times New Roman", "Arial" }, // Vietnamese + { "zh", FONT_CS, FONT_CS }, // Chinese, Simplified + { "zh-HK", FONT_CT, FONT_CT }, // Chinese, Hong Kong + { "zh-MO", FONT_CT, FONT_CT }, // Chinese, Macau + { "zh-TW", FONT_CT, FONT_CT } // Chinese, Taiwan }; } // namespace @@ -84,23 +82,23 @@ static const BuiltinThemeFont spBuiltinThemeFonts[] = // ---------------------------------------------------------------------------- ThemeBuffer::ThemeBuffer( const WorkbookHelper& rHelper ) : - WorkbookHelper( rHelper ), - mxDefFontModel( new FontModel ) + WorkbookHelper( rHelper ), + mxDefFontModel( new FontModel ) { - switch( getFilterType() ) - { - case FILTER_OOXML: - //! TODO: locale dependent font name - mxDefFontModel->maName = CREATE_OUSTRING( "Cambria" ); - mxDefFontModel->mfHeight = 11.0; - break; - case FILTER_BIFF: - //! TODO: BIFF dependent font name - mxDefFontModel->maName = CREATE_OUSTRING( "Arial" ); - mxDefFontModel->mfHeight = 10.0; - break; - case FILTER_UNKNOWN: break; - } + switch( getFilterType() ) + { + case FILTER_OOXML: + //! TODO: locale dependent font name + mxDefFontModel->maName = CREATE_OUSTRING( "Cambria" ); + mxDefFontModel->mfHeight = 11.0; + break; + case FILTER_BIFF: + //! TODO: BIFF dependent font name + mxDefFontModel->maName = CREATE_OUSTRING( "Arial" ); + mxDefFontModel->mfHeight = 10.0; + break; + case FILTER_UNKNOWN: break; + } } ThemeBuffer::~ThemeBuffer() @@ -109,11 +107,13 @@ ThemeBuffer::~ThemeBuffer() sal_Int32 ThemeBuffer::getColorByToken( sal_Int32 nToken ) const { - sal_Int32 nColor = 0; - return getClrScheme().getColor( nToken, nColor ) ? nColor : API_RGB_TRANSPARENT; + sal_Int32 nColor = 0; + return getClrScheme().getColor( nToken, nColor ) ? nColor : API_RGB_TRANSPARENT; } // ============================================================================ } // namespace xls } // namespace oox + +/* vim: set noet sw=4 ts=4: */ diff --git a/main/reportdesign/source/core/sdr/ModuleHelper.cxx b/main/reportdesign/source/core/sdr/ModuleHelper.cxx index 26855b3801..3d1fb41fb8 100644 --- a/main/reportdesign/source/core/sdr/ModuleHelper.cxx +++ b/main/reportdesign/source/core/sdr/ModuleHelper.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,19 +7,18 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ - #include "precompiled_reportdesign.hxx" #include "ModuleHelper.hxx" #include <comphelper/configurationhelper.hxx> @@ -43,22 +42,22 @@ namespace rptui { //......................................................................... - using namespace ::com::sun::star; + using namespace ::com::sun::star; //========================================================================= //= OModuleImpl //========================================================================= -/** implementation for <type>OModule</type>. not threadsafe, has to be guarded by it's owner +/** implementation for <type>OModule</type>. not threadsafe, has to be guarded by its owner */ class OModuleImpl { ResMgr* m_pRessources; public: - /// ctor + // ctor OModuleImpl(); ~OModuleImpl(); - /// get the manager for the resources of the module + // get the manager for the resources of the module ResMgr* getResManager(); }; @@ -67,7 +66,7 @@ DBG_NAME( rpt_OModuleImpl ) OModuleImpl::OModuleImpl() :m_pRessources(NULL) { - DBG_CTOR( rpt_OModuleImpl,NULL); + DBG_CTOR( rpt_OModuleImpl,NULL); } @@ -77,18 +76,18 @@ OModuleImpl::~OModuleImpl() if (m_pRessources) delete m_pRessources; - DBG_DTOR( rpt_OModuleImpl,NULL); + DBG_DTOR( rpt_OModuleImpl,NULL); } //------------------------------------------------------------------------- ResMgr* OModuleImpl::getResManager() { - // note that this method is not threadsafe, which counts for the whole class ! + // note that this method is not threadsafe, which counts for the whole class! if (!m_pRessources) { // create a manager with a fixed prefix - rtl::OString sName = rtl::OString( "rptui" ); + rtl::OString sName = rtl::OString( "rptui" ); m_pRessources = ResMgr::CreateResMgr( sName.getStr()); } return m_pRessources; @@ -133,6 +132,6 @@ void OModule::ensureImpl() s_pImpl = new OModuleImpl(); } -//......................................................................... } // namespace dbaui -//......................................................................... + +/* vim: set noet sw=4 ts=4: */
