View | Details | Raw Unified | Return to issue 4695
Collapse All | Expand All

(-)sc.r1c1/source/core/tool/interpr1.cxx (-3 / +71 lines)
Lines 71-76 Link Here
71
#include "jumpmatrix.hxx"
71
#include "jumpmatrix.hxx"
72
#include "cellkeytranslator.hxx"
72
#include "cellkeytranslator.hxx"
73
#include "lookupcache.hxx"
73
#include "lookupcache.hxx"
74
#include "rangenam.hxx"
74
75
75
#define	SC_DOUBLE_MAXVALUE	1.7e307
76
#define	SC_DOUBLE_MAXVALUE	1.7e307
76
77
Lines 5686-5692 void ScInterpreter::ScIndirectXL() Link Here
5686
		conv = ScAddress::CONV_XL_R1C1;
5687
		conv = ScAddress::CONV_XL_R1C1;
5687
5688
5688
	if ( MustHaveParamCount( nParamCount, 1, 2 )  )
5689
	if ( MustHaveParamCount( nParamCount, 1, 2 )  )
5689
		{
5690
    {
5690
		ScAddress::Details const details( conv, aPos );
5691
		ScAddress::Details const details( conv, aPos );
5691
		SCTAB nTab = aPos.Tab();
5692
		SCTAB nTab = aPos.Tab();
5692
		String sRefStr( GetString() );
5693
		String sRefStr( GetString() );
Lines 5697-5703 void ScInterpreter::ScIndirectXL() Link Here
5697
		else if ( ConvertSingleRef ( pDok, sRefStr, nTab, aRefAd, details ) )
5698
		else if ( ConvertSingleRef ( pDok, sRefStr, nTab, aRefAd, details ) )
5698
			PushSingleRef( aRefAd.Col(), aRefAd.Row(), aRefAd.Tab() );
5699
			PushSingleRef( aRefAd.Col(), aRefAd.Row(), aRefAd.Tab() );
5699
		else
5700
		else
5700
			SetIllegalArgument();
5701
        {
5702
            do
5703
            {
5704
                ScRangeName* pNames = pDok->GetRangeName();
5705
                if (!pNames)
5706
                    break;
5707
5708
                USHORT nPos = 0;
5709
                if (!pNames->SearchName(sRefStr, nPos)) 
5710
                    break;
5711
5712
                ScRangeData* rData = (*pNames)[nPos];
5713
                if (!rData)
5714
                    break;
5715
5716
                rData->ValidateTabRefs();
5717
        
5718
                ScRange aRange;
5719
                if (!rData->IsReference(aRange)) 
5720
                    break;
5721
5722
                if ( aRange.aStart == aRange.aEnd )
5723
                    PushSingleRef(aRange.aStart.Col(), aRange.aStart.Row(), aRange.aStart.Tab());
5724
                else
5725
                    PushDoubleRef(aRange.aStart.Col(), aRange.aStart.Row(), aRange.aStart.Tab(),
5726
                                  aRange.aEnd.Col(), aRange.aEnd.Row(), aRange.aEnd.Tab());
5727
5728
                // success!
5729
                return;
5730
            } 
5731
            while (false);
5732
5733
            SetIllegalArgument();
5734
        }
5701
	}
5735
	}
5702
}
5736
}
5703
5737
Lines 5719-5725 void ScInterpreter::ScIndirect() Link Here
5719
		else if ( ConvertSingleRef( pDok, sRefStr, nTab, aRefAd ) )
5753
		else if ( ConvertSingleRef( pDok, sRefStr, nTab, aRefAd ) )
5720
			PushSingleRef( aRefAd.Col(), aRefAd.Row(), aRefAd.Tab() );
5754
			PushSingleRef( aRefAd.Col(), aRefAd.Row(), aRefAd.Tab() );
5721
		else
5755
		else
5722
			SetIllegalArgument();
5756
        {
5757
            do
5758
            {
5759
                ScRangeName* pNames = pDok->GetRangeName();
5760
                if (!pNames)
5761
                    break;
5762
5763
                USHORT nPos = 0;
5764
                if (!pNames->SearchName(sRefStr, nPos)) 
5765
                    break;
5766
5767
                ScRangeData* rData = (*pNames)[nPos];
5768
                if (!rData)
5769
                    break;
5770
5771
                // we need this in order to obtain good range
5772
                rData->ValidateTabRefs();
5773
        
5774
                ScRange aRange;
5775
                if (!rData->IsReference(aRange)) 
5776
                    break;
5777
5778
                if ( aRange.aStart == aRange.aEnd )
5779
                    PushSingleRef(aRange.aStart.Col(), aRange.aStart.Row(), aRange.aStart.Tab());
5780
                else
5781
                    PushDoubleRef(aRange.aStart.Col(), aRange.aStart.Row(), aRange.aStart.Tab(),
5782
                                  aRange.aEnd.Col(), aRange.aEnd.Row(), aRange.aEnd.Tab());
5783
5784
                // success!
5785
                return;
5786
            } 
5787
            while (false);
5788
5789
            SetIllegalArgument();
5790
        }
5723
	}
5791
	}
5724
}
5792
}
5725
5793

Return to issue 4695