Issue 14864

Summary: return type mismatch - return by value assigned to reference
Product: Writer Reporter: khendricks
Component: codeAssignee: foskey
Status: CLOSED FIXED QA Contact: issues@sw <issues>
Severity: Trivial    
Priority: P1 (highest) CC: issues
Version: OOo 1.1 Beta2   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Issue Depends on:    
Issue Blocks: 13400    

Description khendricks 2003-05-25 19:30:11 UTC
cc 3.3 now provides error messages when there are return type 
mismatches such as when a method returns an object by value 
that is assigned to a reference which is a bug since the 
reference points to a temporary variable created to hold 
the return by value. 
 
An occurrence of this type occurred here see ... (fixme?) 
 
Please evaluate that line and fix the code in question 
to prevent the bug if needed. 
 
starmath/source/register.cxx 
@@ -154,7 
        RTL_CONSTASCII_USTRINGPARAM("/") ) + SmXMLImport_getImplementationName() + 
        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") )  ); 
 
(fixme?)::com::sun::star::uno::Sequence< rtl::OUString > &rServices = 
                SmXMLImport_getSupportedServiceNames(); 
        for(i = 0; i < rServices.getLength(); i++ ) 
                xNewKey->createKey( rServices.getConstArray()[i]);
Comment 1 Martin Hollmichel 2003-05-26 10:01:26 UTC
reassigned and re set prio
Comment 2 Martin Hollmichel 2003-05-26 10:02:03 UTC
reassigned
Comment 3 thomas.lange 2003-05-27 08:46:50 UTC
Fixed in CWS sw015.
Files changed
  register.cxx 1.5.22.1
Comment 4 thomas.lange 2003-05-28 15:36:51 UTC
.
Comment 5 thomas.lange 2003-05-28 15:40:08 UTC
TL->Kevin: Please have a look...
Comment 6 thomas.lange 2003-05-28 15:40:34 UTC
.
Comment 7 foskey 2003-06-10 14:11:02 UTC
The Following lines of code must be changed to remove the
SAL_ISO_CONST.  This is a temporary hack.

./sw/source/ui/uno/SwXDocumentSettings.cxx:                    
SAL_ISO_CONST SwDBData& rData = mpDoc->GetDBData();
./sw/source/ui/uno/SwXDocumentSettings.cxx:                    
SAL_ISO_CONST SwDBData& rData = mpDoc->GetDBData();
./sw/source/ui/uno/SwXDocumentSettings.cxx:                    
SAL_ISO_CONST SwDBData& rData = mpDoc->GetDBData();
Comment 8 khendricks 2003-06-30 15:48:04 UTC
Hi  
 
Re-assigneing this to Ken so that he can commit the fix and test it since he is using 
gcc 3.3 for his builds. 
 
Thanks, 
 
Kevin 
 
Comment 9 foskey 2003-07-01 15:18:12 UTC
These occurrence have been removed.  Closing issue.
Comment 10 caolanm 2003-07-01 15:41:31 UTC
Use "close" if you want to close this fully.
Comment 11 foskey 2003-07-31 02:36:14 UTC
Closing