Changeset 80
- Timestamp:
- 04/17/06 09:21:47 (3 years ago)
- Location:
- trunk
- Files:
-
- 2 modified
-
src/IDocument.cxx (modified) (10 diffs)
-
tests/MainPterTest.cxx (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/IDocument.cxx
r78 r80 188 188 IDocument::setTitle (gchar *title) 189 189 { 190 g_free (m_Title); 191 m_Title = title; 190 gchar *oldTitle = m_Title; 191 m_Title = g_strdup (title); 192 g_free (oldTitle); 193 g_free (title); 192 194 } 193 195 … … 216 218 IDocument::setAuthor (gchar *author) 217 219 { 218 g_free (m_Author); 219 m_Author = author; 220 gchar *oldAuthor = m_Author; 221 m_Author = g_strdup (author); 222 g_free (oldAuthor); 223 g_free (author); 220 224 } 221 225 … … 244 248 IDocument::setSubject (gchar *subject) 245 249 { 246 g_free (m_Subject); 250 gchar *oldSubject = m_Subject; 251 m_Subject = g_strdup (subject); 252 g_free (oldSubject); 247 253 m_Subject = subject; 248 254 } … … 273 279 IDocument::setKeywords (gchar *keywords) 274 280 { 275 g_free (m_Keywords); 276 m_Keywords = keywords; 281 gchar *oldKeywords = m_Keywords; 282 m_Keywords = g_strdup (keywords); 283 g_free (oldKeywords); 284 g_free (keywords); 277 285 } 278 286 … … 302 310 IDocument::setCreator (gchar *creator) 303 311 { 304 g_free (m_Creator); 305 m_Creator = creator; 312 gchar *oldCreator = m_Creator; 313 m_Creator = g_strdup (creator); 314 g_free (oldCreator); 315 g_free (creator); 306 316 } 307 317 /// … … 330 340 IDocument::setProducer (gchar *producer) 331 341 { 332 g_free (m_Producer); 333 m_Producer = producer; 342 gchar *oldProducer = m_Producer; 343 m_Producer = g_strdup (producer); 344 g_free (oldProducer); 345 g_free (producer); 334 346 } 335 347 … … 360 372 IDocument::setFormat (gchar *format) 361 373 { 362 g_free (m_Format); 363 m_Format = format; 374 gchar *oldFormat = m_Format; 375 m_Format = g_strdup (format); 376 g_free (oldFormat); 377 g_free (format); 364 378 } 365 379 … … 390 404 IDocument::setLinearized (gchar *linearized) 391 405 { 392 g_free (m_Linearized); 393 m_Linearized = linearized; 406 gchar *oldLinearized = m_Linearized; 407 m_Linearized = g_strdup (linearized); 408 g_free (oldLinearized); 409 g_free (linearized); 394 410 } 395 411 … … 419 435 IDocument::setCreationDate (gchar *date) 420 436 { 421 g_free (m_CreationDate); 422 m_CreationDate = date; 437 gchar *oldCreationDate = m_CreationDate; 438 m_CreationDate = g_strdup (date); 439 g_free (oldCreationDate); 440 g_free (date); 423 441 } 424 442 … … 448 466 IDocument::setModifiedDate (gchar *date) 449 467 { 450 g_free (m_ModifiedDate); 451 m_ModifiedDate = date; 468 gchar *oldModifiedDate = m_ModifiedDate; 469 m_ModifiedDate = g_strdup (date); 470 g_free (oldModifiedDate); 471 g_free (date); 452 472 } 453 473 -
trunk/tests/MainPterTest.cxx
r73 r80 112 112 113 113 // Now try a document with a title. 114 m_Document->setTitle ( "Test PDF");114 m_Document->setTitle (g_strdup ("Test PDF")); 115 115 m_MainPter->openFileActivated (); 116 116 CPPUNIT_ASSERT_EQUAL (0,
