characterdata.cxx (e9cbe144) characterdata.cxx (24c56ab9)
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

--- 75 unchanged lines hidden (view full) ---

84 ::osl::ClearableMutexGuard guard(m_rMutex);
85
86 if (m_aNodePtr != NULL)
87 {
88 // get current data
89 ::boost::shared_ptr<xmlChar const> const pContent(
90 xmlNodeGetContent(m_aNodePtr), xmlFree);
91 OString aData(reinterpret_cast<sal_Char const*>(pContent.get()));
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

--- 75 unchanged lines hidden (view full) ---

84 ::osl::ClearableMutexGuard guard(m_rMutex);
85
86 if (m_aNodePtr != NULL)
87 {
88 // get current data
89 ::boost::shared_ptr<xmlChar const> const pContent(
90 xmlNodeGetContent(m_aNodePtr), xmlFree);
91 OString aData(reinterpret_cast<sal_Char const*>(pContent.get()));
92 OUString tmp(aData, aData.getLength(), RTL_TEXTENCODING_UTF8);
92 OUString tmp( aData.getStr(), aData.getLength(), RTL_TEXTENCODING_UTF8);
93 if (offset > tmp.getLength() || offset < 0 || count < 0) {
94 DOMException e;
95 e.Code = DOMExceptionType_INDEX_SIZE_ERR;
96 throw e;
97 }
98 if ((offset+count) > tmp.getLength())
99 count = tmp.getLength() - offset;
100

--- 54 unchanged lines hidden (view full) ---

155 ::osl::ClearableMutexGuard guard(m_rMutex);
156
157 if (m_aNodePtr != NULL)
158 {
159 // get current data
160 ::boost::shared_ptr<xmlChar const> const pContent(
161 xmlNodeGetContent(m_aNodePtr), xmlFree);
162 OString aData(reinterpret_cast<sal_Char const*>(pContent.get()));
93 if (offset > tmp.getLength() || offset < 0 || count < 0) {
94 DOMException e;
95 e.Code = DOMExceptionType_INDEX_SIZE_ERR;
96 throw e;
97 }
98 if ((offset+count) > tmp.getLength())
99 count = tmp.getLength() - offset;
100

--- 54 unchanged lines hidden (view full) ---

155 ::osl::ClearableMutexGuard guard(m_rMutex);
156
157 if (m_aNodePtr != NULL)
158 {
159 // get current data
160 ::boost::shared_ptr<xmlChar const> const pContent(
161 xmlNodeGetContent(m_aNodePtr), xmlFree);
162 OString aData(reinterpret_cast<sal_Char const*>(pContent.get()));
163 OUString tmp(aData, aData.getLength(), RTL_TEXTENCODING_UTF8);
163 OUString tmp( aData.getStr(), aData.getLength(), RTL_TEXTENCODING_UTF8);
164 if (offset > tmp.getLength() || offset < 0) {
165 DOMException e;
166 e.Code = DOMExceptionType_INDEX_SIZE_ERR;
167 throw e;
168 }
169
170 OUString tmp2 = tmp.copy(0, offset);
171 tmp2 += arg;

--- 18 unchanged lines hidden (view full) ---

190 ::osl::ClearableMutexGuard guard(m_rMutex);
191
192 if (m_aNodePtr != NULL)
193 {
194 // get current data
195 ::boost::shared_ptr<xmlChar const> const pContent(
196 xmlNodeGetContent(m_aNodePtr), xmlFree);
197 OString aData(reinterpret_cast<sal_Char const*>(pContent.get()));
164 if (offset > tmp.getLength() || offset < 0) {
165 DOMException e;
166 e.Code = DOMExceptionType_INDEX_SIZE_ERR;
167 throw e;
168 }
169
170 OUString tmp2 = tmp.copy(0, offset);
171 tmp2 += arg;

--- 18 unchanged lines hidden (view full) ---

190 ::osl::ClearableMutexGuard guard(m_rMutex);
191
192 if (m_aNodePtr != NULL)
193 {
194 // get current data
195 ::boost::shared_ptr<xmlChar const> const pContent(
196 xmlNodeGetContent(m_aNodePtr), xmlFree);
197 OString aData(reinterpret_cast<sal_Char const*>(pContent.get()));
198 OUString tmp(aData, aData.getLength(), RTL_TEXTENCODING_UTF8);
198 OUString tmp( aData.getStr(), aData.getLength(), RTL_TEXTENCODING_UTF8);
199 if (offset > tmp.getLength() || offset < 0 || count < 0){
200 DOMException e;
201 e.Code = DOMExceptionType_INDEX_SIZE_ERR;
202 throw e;
203 }
204 if ((offset+count) > tmp.getLength())
205 count = tmp.getLength() - offset;
206

--- 38 unchanged lines hidden (view full) ---

245
246 OUString aStr;
247 if (m_aNodePtr != NULL)
248 {
249 // get current data
250 ::boost::shared_ptr<xmlChar const> const pContent(
251 xmlNodeGetContent(m_aNodePtr), xmlFree);
252 OString aData(reinterpret_cast<sal_Char const*>(pContent.get()));
199 if (offset > tmp.getLength() || offset < 0 || count < 0){
200 DOMException e;
201 e.Code = DOMExceptionType_INDEX_SIZE_ERR;
202 throw e;
203 }
204 if ((offset+count) > tmp.getLength())
205 count = tmp.getLength() - offset;
206

--- 38 unchanged lines hidden (view full) ---

245
246 OUString aStr;
247 if (m_aNodePtr != NULL)
248 {
249 // get current data
250 ::boost::shared_ptr<xmlChar const> const pContent(
251 xmlNodeGetContent(m_aNodePtr), xmlFree);
252 OString aData(reinterpret_cast<sal_Char const*>(pContent.get()));
253 OUString tmp(aData, aData.getLength(), RTL_TEXTENCODING_UTF8);
253 OUString tmp( aData.getStr(), aData.getLength(), RTL_TEXTENCODING_UTF8);
254 if (offset > tmp.getLength() || offset < 0 || count < 0) {
255 DOMException e;
256 e.Code = DOMExceptionType_INDEX_SIZE_ERR;
257 throw e;
258 }
259 aStr = tmp.copy(offset, count);
260 }
261 return aStr;
262 }
263
264
265} // namspace DOM
266
254 if (offset > tmp.getLength() || offset < 0 || count < 0) {
255 DOMException e;
256 e.Code = DOMExceptionType_INDEX_SIZE_ERR;
257 throw e;
258 }
259 aStr = tmp.copy(offset, count);
260 }
261 return aStr;
262 }
263
264
265} // namspace DOM
266