parawin.cxx (c25918c1) | parawin.cxx (1b1b70fb) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 26 unchanged lines hidden (view full) --- 35#include "parawin.hrc" 36#include "helpids.hrc" 37#include "formula/formdata.hxx" 38#include "formula/IFunctionDescription.hxx" 39#include "ModuleHelper.hxx" 40#include "ForResId.hrc" 41 42#define VAR_ARGS 30 | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 26 unchanged lines hidden (view full) --- 35#include "parawin.hrc" 36#include "helpids.hrc" 37#include "formula/formdata.hxx" 38#include "formula/IFunctionDescription.hxx" 39#include "ModuleHelper.hxx" 40#include "ForResId.hrc" 41 42#define VAR_ARGS 30 |
43#define PAIRED_VAR_ARGS (VAR_ARGS + VAR_ARGS) |
|
43namespace formula 44{ 45//============================================================================ 46 47ParaWin::ParaWin(Window* pParent,IControlReferenceHandler* _pDlg,Point aPos): 48 TabPage (pParent,ModuleRes(RID_FORMULATAB_PARAMETER)), 49 pFuncDesc ( NULL ), 50 pMyParent (_pDlg), --- 70 unchanged lines hidden (view full) --- 121 if ( nArgs < VAR_ARGS ) 122 { 123 sal_uInt16 nRealArg = (aVisibleArgMapping.size() < nArg) ? aVisibleArgMapping[nArg] : nArg; 124 aArgDesc = pFuncDesc->getParameterDescription(nRealArg); 125 aArgName = pFuncDesc->getParameterName(nRealArg); 126 aArgName += ' '; 127 aArgName += (pFuncDesc->isParameterOptional(nRealArg)) ? m_sOptional : m_sRequired ; 128 } | 44namespace formula 45{ 46//============================================================================ 47 48ParaWin::ParaWin(Window* pParent,IControlReferenceHandler* _pDlg,Point aPos): 49 TabPage (pParent,ModuleRes(RID_FORMULATAB_PARAMETER)), 50 pFuncDesc ( NULL ), 51 pMyParent (_pDlg), --- 70 unchanged lines hidden (view full) --- 122 if ( nArgs < VAR_ARGS ) 123 { 124 sal_uInt16 nRealArg = (aVisibleArgMapping.size() < nArg) ? aVisibleArgMapping[nArg] : nArg; 125 aArgDesc = pFuncDesc->getParameterDescription(nRealArg); 126 aArgName = pFuncDesc->getParameterName(nRealArg); 127 aArgName += ' '; 128 aArgName += (pFuncDesc->isParameterOptional(nRealArg)) ? m_sOptional : m_sRequired ; 129 } |
129 else | 130 else if ( nArgs < PAIRED_VAR_ARGS ) |
130 { 131 sal_uInt16 nFix = nArgs - VAR_ARGS; 132 sal_uInt16 nPos = ( nArg < nFix ? nArg : nFix ); 133 sal_uInt16 nRealArg = (nPos < aVisibleArgMapping.size() ? 134 aVisibleArgMapping[nPos] : aVisibleArgMapping.back()); 135 aArgDesc = pFuncDesc->getParameterDescription(nRealArg); 136 aArgName = pFuncDesc->getParameterName(nRealArg); 137 if ( nArg >= nFix ) 138 aArgName += String::CreateFromInt32(nArg-nFix+1); 139 aArgName += ' '; 140 141 aArgName += (nArg > nFix || pFuncDesc->isParameterOptional(nRealArg)) ? m_sOptional : m_sRequired ; 142 } | 131 { 132 sal_uInt16 nFix = nArgs - VAR_ARGS; 133 sal_uInt16 nPos = ( nArg < nFix ? nArg : nFix ); 134 sal_uInt16 nRealArg = (nPos < aVisibleArgMapping.size() ? 135 aVisibleArgMapping[nPos] : aVisibleArgMapping.back()); 136 aArgDesc = pFuncDesc->getParameterDescription(nRealArg); 137 aArgName = pFuncDesc->getParameterName(nRealArg); 138 if ( nArg >= nFix ) 139 aArgName += String::CreateFromInt32(nArg-nFix+1); 140 aArgName += ' '; 141 142 aArgName += (nArg > nFix || pFuncDesc->isParameterOptional(nRealArg)) ? m_sOptional : m_sRequired ; 143 } |
144 else 145 { 146 sal_uInt16 nFix = nArgs - PAIRED_VAR_ARGS; 147 sal_uInt16 nPos; 148 if ( nArg < nFix ) 149 nPos = nArg; 150 else 151 nPos = nFix + ( (nArg-nFix) % 2); 152 sal_uInt16 nRealArg = (nPos < aVisibleArgMapping.size() ? 153 aVisibleArgMapping[nPos] : aVisibleArgMapping.back()); 154 aArgDesc = pFuncDesc->getParameterDescription(nRealArg); 155 aArgName = pFuncDesc->getParameterName(nRealArg); 156 if ( nArg >= nFix ) 157 aArgName += String::CreateFromInt32((nArg-nFix)/2 + 1); 158 aArgName += ' '; |
|
143 | 159 |
160 aArgName += (nArg > (nFix+1) || pFuncDesc->isParameterOptional(nRealArg)) ? m_sOptional : m_sRequired ; 161 } 162 |
|
144 SetArgumentDesc(aArgDesc); 145 SetArgumentText(aArgName); 146 } 147} 148 149void ParaWin::UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 i ) 150{ 151 sal_uInt16 nArg = nOffset + i; 152 if ( nArgs < VAR_ARGS) 153 { 154 if(nArg<nArgs) 155 { 156 sal_uInt16 nRealArg = aVisibleArgMapping[nArg]; 157 SetArgNameFont (i,(pFuncDesc->isParameterOptional(nRealArg)) 158 ? aFntLight : aFntBold ); 159 SetArgName (i,pFuncDesc->getParameterName(nRealArg)); 160 } 161 } | 163 SetArgumentDesc(aArgDesc); 164 SetArgumentText(aArgName); 165 } 166} 167 168void ParaWin::UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 i ) 169{ 170 sal_uInt16 nArg = nOffset + i; 171 if ( nArgs < VAR_ARGS) 172 { 173 if(nArg<nArgs) 174 { 175 sal_uInt16 nRealArg = aVisibleArgMapping[nArg]; 176 SetArgNameFont (i,(pFuncDesc->isParameterOptional(nRealArg)) 177 ? aFntLight : aFntBold ); 178 SetArgName (i,pFuncDesc->getParameterName(nRealArg)); 179 } 180 } |
162 else | 181 else if ( nArgs < PAIRED_VAR_ARGS) |
163 { 164 sal_uInt16 nFix = nArgs - VAR_ARGS; 165 sal_uInt16 nPos = ( nArg < nFix ? nArg : nFix ); 166 sal_uInt16 nRealArg = (nPos < aVisibleArgMapping.size() ? 167 aVisibleArgMapping[nPos] : aVisibleArgMapping.back()); 168 SetArgNameFont( i, 169 (nArg > nFix || pFuncDesc->isParameterOptional(nRealArg)) ? 170 aFntLight : aFntBold ); 171 if ( nArg >= nFix ) 172 { 173 String aArgName( pFuncDesc->getParameterName(nRealArg) ); 174 aArgName += String::CreateFromInt32(nArg-nFix+1); 175 SetArgName( i, aArgName ); 176 } 177 else 178 SetArgName( i, pFuncDesc->getParameterName(nRealArg) ); 179 } | 182 { 183 sal_uInt16 nFix = nArgs - VAR_ARGS; 184 sal_uInt16 nPos = ( nArg < nFix ? nArg : nFix ); 185 sal_uInt16 nRealArg = (nPos < aVisibleArgMapping.size() ? 186 aVisibleArgMapping[nPos] : aVisibleArgMapping.back()); 187 SetArgNameFont( i, 188 (nArg > nFix || pFuncDesc->isParameterOptional(nRealArg)) ? 189 aFntLight : aFntBold ); 190 if ( nArg >= nFix ) 191 { 192 String aArgName( pFuncDesc->getParameterName(nRealArg) ); 193 aArgName += String::CreateFromInt32(nArg-nFix+1); 194 SetArgName( i, aArgName ); 195 } 196 else 197 SetArgName( i, pFuncDesc->getParameterName(nRealArg) ); 198 } |
199 else 200 { 201 sal_uInt16 nFix = nArgs - PAIRED_VAR_ARGS; 202 sal_uInt16 nPos; 203 if ( nArg < nFix ) 204 nPos = nArg; 205 else 206 nPos = nFix + ( (nArg-nFix) % 2); 207 sal_uInt16 nRealArg = (nPos < aVisibleArgMapping.size() ? 208 aVisibleArgMapping[nPos] : aVisibleArgMapping.back()); 209 SetArgNameFont( i, 210 (nArg > (nFix+1) || pFuncDesc->isParameterOptional(nRealArg)) ? 211 aFntLight : aFntBold ); 212 if ( nArg >= nFix ) 213 { 214 String aArgName( pFuncDesc->getParameterName(nRealArg) ); 215 aArgName += String::CreateFromInt32((nArg-nFix)/2 + 1); 216 SetArgName( i, aArgName ); 217 } 218 else 219 SetArgName( i, pFuncDesc->getParameterName(nRealArg) ); 220 } |
|
180 if(nArg<nArgs) SetArgVal(i,aParaArray[nArg]); 181 //@ aArgInput[i].SetArgVal( *(pArgArr[nOffset+i]) ); 182 183} 184 185ParaWin::~ParaWin() 186{ 187 // #i66422# if the focus changes during destruction of the controls, --- 409 unchanged lines hidden --- | 221 if(nArg<nArgs) SetArgVal(i,aParaArray[nArg]); 222 //@ aArgInput[i].SetArgVal( *(pArgArr[nOffset+i]) ); 223 224} 225 226ParaWin::~ParaWin() 227{ 228 // #i66422# if the focus changes during destruction of the controls, --- 409 unchanged lines hidden --- |