Issue 14866 - return type mismatch - return by value assigned to reference
Summary: return type mismatch - return by value assigned to reference
Status: CLOSED FIXED
Alias: None
Product: Calc
Classification: Application
Component: code (show other issues)
Version: OOo 1.1 Beta2
Hardware: All All
: P1 (highest) Trivial (vote)
Target Milestone: ---
Assignee: khendricks
QA Contact: issues@sc
URL:
Keywords:
Depends on:
Blocks: 13400
  Show dependency tree
 
Reported: 2003-05-25 19:35 UTC by khendricks
Modified: 2013-08-07 15:12 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description khendricks 2003-05-25 19:35:50 UTC
gcc 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. 
sc/source/core/tool/compiler.cxx 
@@ -2989,7 
     for( ScToken* t = pArr->GetNextReference(); t; 
                   t = pArr->GetNextReference() ) 
     { 
(fixme?)     SingleDoubleRefModifier& rMod = (t->GetType() == svSingleRef ? 
             SingleDoubleRefModifier( t->GetSingleRef() ) : 
             SingleDoubleRefModifier( t->GetDoubleRef() )); 
         ComplRefData& rRef = rMod.Ref(); 
 
 
 
 
 
sc/source/core/tool/compiler.cxx 
@@ -3029,7 
                 // Absolute references have been already adjusted in the named 
                 // shared formula itself prior to breaking the shared formula 
                 // and calling this function. Don't readjust them again. 
(fixme?)         SingleDoubleRefModifier& rMod = (t->GetType() == svSingleRef ? 
                     SingleDoubleRefModifier( t->GetSingleRef() ) : 
                     SingleDoubleRefModifier( t->GetDoubleRef() )); 
                 ComplRefData& rRef = rMod.Ref(); 
 
 
 
 
 
sc/source/core/tool/rangenam.cxx 
@@ -390,7 
        { 
                if( t->GetType() != svIndex ) 
                { 
(fixme?)                SingleDoubleRefModifier& rMod = (t->GetType() == svSingleRef ? 
                                SingleDoubleRefModifier( t->GetSingleRef() ) : 
                                SingleDoubleRefModifier( t->GetDoubleRef() )); 
                        ComplRefData& rRef = rMod.Ref(); 
 
 
sc/source/core/tool/rangenam.cxx 
@@ -420,7 
        { 
                if( t->GetType() != svIndex ) 
                { 
(fixme?)                SingleDoubleRefModifier& rMod = (t->GetType() == svSingleRef ? 
                                SingleDoubleRefModifier( t->GetSingleRef() ) : 
                                SingleDoubleRefModifier( t->GetDoubleRef() )); 
                        ComplRefData& rRef = rMod.Ref(); 
 
 
 
sc/source/core/data/cell2.cxx 
@@ -1198,7 
             t->CalcAbsIfRel( aOldPos ); 
             BOOL bMod; 
             {   // own scope for SingleDoubleRefModifier dtor if SingleRef 
(fixme?)         SingleDoubleRefModifier& rMod = (t->GetType() == svSingleRef ? 
                     SingleDoubleRefModifier( t->GetSingleRef() ) : 
                     SingleDoubleRefModifier( t->GetDoubleRef() )); 
                 ComplRefData& rRef = rMod.Ref(); 
 
 
sc/source/core/data/cell2.cxx 
@@ -1227,7 
                 t->CalcAbsIfRel( aOldPos ); 
                 BOOL bMod; 
                 {   // own scope for SingleDoubleRefModifier dtor if SingleRef 
(fixme?)             SingleDoubleRefModifier& rMod = (t->GetType() == svSingleRef ? 
                         SingleDoubleRefModifier( t->GetSingleRef() ) : 
                         SingleDoubleRefModifier( t->GetDoubleRef() )); 
                     ComplRefData& rRef = rMod.Ref(); 
 
 
 
sc/source/core/data/cell2.cxx 
@@ -1286,7 
             t->CalcAbsIfRel( aPos ); 
             BOOL bMod; 
             {   // own scope for SingleDoubleRefModifier dtor if SingleRef 
(fixme?)         SingleDoubleRefModifier& rMod = (t->GetType() == svSingleRef ? 
                     SingleDoubleRefModifier( t->GetSingleRef() ) : 
                     SingleDoubleRefModifier( t->GetDoubleRef() )); 
                 ComplRefData& rRef = rMod.Ref(); 
 
 
 
 
sc/source/core/data/cell2.cxx 
@@ -1315,7 +1315,7 @@ 
                 t->CalcAbsIfRel( aPos ); 
                 BOOL bMod; 
                 {   // own scope for SingleDoubleRefModifier dtor if SingleRef 
(fixme?)             SingleDoubleRefModifier& rMod = (t->GetType() == svSingleRef ? 
                         SingleDoubleRefModifier( t->GetSingleRef() ) : 
                         SingleDoubleRefModifier( t->GetDoubleRef() )); 
                     ComplRefData& rRef = rMod.Ref();
Comment 1 frank 2003-05-26 08:10:47 UTC
Hi Niklas,

it seems this one is yours.

Frank
Comment 2 Martin Hollmichel 2003-05-26 10:04:10 UTC
reassigned and reset prio
Comment 3 niklas.nebel 2003-05-26 12:20:04 UTC
It's Eike's code.
Comment 4 ooo 2003-05-26 19:50:18 UTC
accepted
Comment 5 sascha.ballach 2003-05-27 17:33:06 UTC
review done
Comment 6 ooo 2003-05-27 18:00:07 UTC
Fixed on branch cws_srx644_ooo11beta2:

sc/inc/token.hxx  1.6.138.1
sc/source/core/data/cell2.cxx  1.17.140.3
sc/source/core/tool/compiler.cxx  1.40.24.3
sc/source/core/tool/rangenam.cxx  1.12.32.3
Comment 7 ooo 2003-06-12 16:00:49 UTC
Kevin,
please verify in cws_srx644_ooo11beta2 and close if present in
SRX645_m5s1 or later.
Comment 8 michael.bemmer 2003-06-16 14:49:37 UTC
I guess resolved fixed is the correct status for this one.
Comment 9 frank 2003-08-07 15:40:06 UTC
set to verified
Comment 10 frank 2003-08-07 15:41:55 UTC
closed verified