svgtoken.cxx (86d02030) | svgtoken.cxx (52cb04b8) |
---|---|
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 --- 153 unchanged lines hidden (view full) --- 162 static rtl::OUString aSVGStrStrokeLinejoin(rtl::OUString::createFromAscii("stroke-linejoin")); 163 static rtl::OUString aSVGStrStrokeMiterlimit(rtl::OUString::createFromAscii("stroke-miterlimit")); 164 static rtl::OUString aSVGStrStrokeOpacity(rtl::OUString::createFromAscii("stroke-opacity")); 165 static rtl::OUString aSVGStrStrokeWidth(rtl::OUString::createFromAscii("stroke-width")); 166 167 static rtl::OUString aSVGStrText(rtl::OUString::createFromAscii("text")); 168 static rtl::OUString aSVGStrBaselineShift(rtl::OUString::createFromAscii("baseline-shift")); 169 | 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 --- 153 unchanged lines hidden (view full) --- 162 static rtl::OUString aSVGStrStrokeLinejoin(rtl::OUString::createFromAscii("stroke-linejoin")); 163 static rtl::OUString aSVGStrStrokeMiterlimit(rtl::OUString::createFromAscii("stroke-miterlimit")); 164 static rtl::OUString aSVGStrStrokeOpacity(rtl::OUString::createFromAscii("stroke-opacity")); 165 static rtl::OUString aSVGStrStrokeWidth(rtl::OUString::createFromAscii("stroke-width")); 166 167 static rtl::OUString aSVGStrText(rtl::OUString::createFromAscii("text")); 168 static rtl::OUString aSVGStrBaselineShift(rtl::OUString::createFromAscii("baseline-shift")); 169 |
170 SVGToken StrToSVGToken(const rtl::OUString& rStr) | 170 SVGToken StrToSVGToken(const rtl::OUString& rStr, bool bCaseIndependent) |
171 { 172 typedef std::hash_map< rtl::OUString, SVGToken, rtl::OUStringHash > SVGTokenMapper; 173 typedef std::pair< rtl::OUString, SVGToken > SVGTokenValueType; 174 static SVGTokenMapper aSVGTokenMapperList; 175 176 if(aSVGTokenMapperList.empty()) 177 { 178 aSVGTokenMapperList.insert(SVGTokenValueType(aSVGStrWidth, SVGTokenWidth)); --- 131 unchanged lines hidden (view full) --- 310 aSVGTokenMapperList.insert(SVGTokenValueType(aSVGStrText, SVGTokenText)); 311 aSVGTokenMapperList.insert(SVGTokenValueType(aSVGStrBaselineShift, SVGTokenBaselineShift)); 312 } 313 314 const SVGTokenMapper::const_iterator aResult(aSVGTokenMapperList.find(rStr)); 315 316 if(aResult == aSVGTokenMapperList.end()) 317 { | 171 { 172 typedef std::hash_map< rtl::OUString, SVGToken, rtl::OUStringHash > SVGTokenMapper; 173 typedef std::pair< rtl::OUString, SVGToken > SVGTokenValueType; 174 static SVGTokenMapper aSVGTokenMapperList; 175 176 if(aSVGTokenMapperList.empty()) 177 { 178 aSVGTokenMapperList.insert(SVGTokenValueType(aSVGStrWidth, SVGTokenWidth)); --- 131 unchanged lines hidden (view full) --- 310 aSVGTokenMapperList.insert(SVGTokenValueType(aSVGStrText, SVGTokenText)); 311 aSVGTokenMapperList.insert(SVGTokenValueType(aSVGStrBaselineShift, SVGTokenBaselineShift)); 312 } 313 314 const SVGTokenMapper::const_iterator aResult(aSVGTokenMapperList.find(rStr)); 315 316 if(aResult == aSVGTokenMapperList.end()) 317 { |
318 if(bCaseIndependent) 319 { 320 static SVGTokenMapper aCaseLindependentSVGTokenMapperList; 321 322 if(aCaseLindependentSVGTokenMapperList.empty()) 323 { 324 for(SVGTokenMapper::const_iterator aCurrent(aSVGTokenMapperList.begin()); aCurrent != aSVGTokenMapperList.end(); aCurrent++) 325 { 326 aCaseLindependentSVGTokenMapperList.insert( 327 SVGTokenValueType( 328 aCurrent->first.toAsciiLowerCase(), 329 aCurrent->second)); 330 } 331 } 332 333 const SVGTokenMapper::const_iterator aResult2(aCaseLindependentSVGTokenMapperList.find(rStr.toAsciiLowerCase())); 334 335 if(aResult2 == aCaseLindependentSVGTokenMapperList.end()) 336 { 337 return SVGTokenUnknown; 338 } 339 else 340 { 341 return aResult2->second; 342 } 343 } 344 |
|
318 return SVGTokenUnknown; 319 } 320 else 321 { 322 return aResult->second; 323 } 324 } 325 --- 14 unchanged lines hidden --- | 345 return SVGTokenUnknown; 346 } 347 else 348 { 349 return aResult->second; 350 } 351 } 352 --- 14 unchanged lines hidden --- |