Commit b4127fb1 authored by Albert Astals Cid's avatar Albert Astals Cid

Add some more const

const is always good :)
parent a8e93f46
/*
* Copyright (C) 2009-2011, Pino Toscano <pino@kde.org>
* Copyright (C) 2016 Jakub Alba <jakubalba@gmail.com>
* Copyright (C) 2018 Albert Astals Cid <aacid@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -78,7 +79,7 @@ bool embedded_file::is_valid() const
*/
std::string embedded_file::name() const
{
GooString *goo = d->file_spec->getFileName();
const GooString *goo = d->file_spec->getFileName();
return goo ? std::string(goo->getCString()) : std::string();
}
......@@ -87,7 +88,7 @@ std::string embedded_file::name() const
*/
ustring embedded_file::description() const
{
GooString *goo = d->file_spec->getDescription();
const GooString *goo = d->file_spec->getDescription();
return goo ? detail::unicode_GooString_to_ustring(goo) : ustring();
}
......@@ -108,7 +109,7 @@ int embedded_file::size() const
*/
time_type embedded_file::modification_date() const
{
GooString *goo = d->file_spec->getEmbeddedFile()->modDate();
const GooString *goo = d->file_spec->getEmbeddedFile()->modDate();
return goo ? dateStringToTime(goo) : time_type(-1);
}
......@@ -118,7 +119,7 @@ time_type embedded_file::modification_date() const
*/
time_type embedded_file::creation_date() const
{
GooString *goo = d->file_spec->getEmbeddedFile()->createDate();
const GooString *goo = d->file_spec->getEmbeddedFile()->createDate();
return goo ? dateStringToTime(goo) : time_type(-1);
}
......@@ -127,7 +128,7 @@ time_type embedded_file::creation_date() const
*/
byte_array embedded_file::checksum() const
{
GooString *cs = d->file_spec->getEmbeddedFile()->checksum();
const GooString *cs = d->file_spec->getEmbeddedFile()->checksum();
if (!cs) {
return byte_array();
}
......@@ -144,7 +145,7 @@ byte_array embedded_file::checksum() const
*/
std::string embedded_file::mime_type() const
{
GooString *goo = d->file_spec->getEmbeddedFile()->mimeType();
const GooString *goo = d->file_spec->getEmbeddedFile()->mimeType();
return goo ? std::string(goo->getCString()) : std::string();
}
......
......@@ -3,7 +3,7 @@
* Copyright (C) 2013 Adrian Johnson <ajohnson@redneon.com>
* Copyright (C) 2014, Hans-Peter Deifel <hpdeifel@gmx.de>
* Copyright (C) 2016 Jakub Alba <jakubalba@gmail.com>
* Copyright (C) 2017 Albert Astals Cid <aacid@kde.org>
* Copyright (C) 2017, 2018 Albert Astals Cid <aacid@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -56,7 +56,7 @@ rectf detail::pdfrectangle_to_rectf(const PDFRectangle &pdfrect)
return rectf(pdfrect.x1, pdfrect.y1, pdfrect.x2 - pdfrect.x1, pdfrect.y2 - pdfrect.y1);
}
ustring detail::unicode_GooString_to_ustring(GooString *str)
ustring detail::unicode_GooString_to_ustring(const GooString *str)
{
const char *data = str->getCString();
const int len = str->getLength();
......
......@@ -5,6 +5,7 @@
* Copyright (C) 2016 Jakub Alba <jakubalba@gmail.com>
* Copyright (C) 2018, Suzuki Toshiya <mpsuzuki@hiroshima-u.ac.jp>
* Copyright (C) 2018, Adam Reichold <adam.reichold@t-online.de>
* Copyright (C) 2018 Albert Astals Cid <aacid@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -49,7 +50,7 @@ void error_function(void *data, ErrorCategory category, Goffset pos, char *msg);
rectf pdfrectangle_to_rectf(const PDFRectangle &pdfrect);
ustring unicode_GooString_to_ustring(GooString *str);
ustring unicode_GooString_to_ustring(const GooString *str);
ustring unicode_to_ustring(const Unicode *u, int length);
GooString* ustring_to_unicode_GooString(const ustring &str);
......
......@@ -53,8 +53,8 @@ public:
toc_item_private(const toc_item_private &) = delete;
toc_item_private& operator=(const toc_item_private &) = delete;
void load(OutlineItem *item);
void load_children(GooList *items);
void load(const OutlineItem *item);
void load_children(const GooList *items);
std::vector<toc_item*> children;
ustring title;
......
/*
* Copyright (C) 2009-2010, Pino Toscano <pino@kde.org>
* Copyright (C) 2018, Albert Astals Cid <aacid@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -40,7 +41,7 @@ toc* toc_private::load_from_outline(Outline *outline)
return nullptr;
}
GooList *items = outline->getItems();
const GooList *items = outline->getItems();
if (!items || items->getLength() < 1) {
return nullptr;
}
......@@ -62,7 +63,7 @@ toc_item_private::~toc_item_private()
delete_all(children);
}
void toc_item_private::load(OutlineItem *item)
void toc_item_private::load(const OutlineItem *item)
{
const Unicode *title_unicode = item->getTitle();
const int title_length = item->getTitleLength();
......@@ -70,7 +71,7 @@ void toc_item_private::load(OutlineItem *item)
is_open = item->isOpen();
}
void toc_item_private::load_children(GooList *items)
void toc_item_private::load_children(const GooList *items)
{
const int num_items = items->getLength();
children.resize(num_items);
......@@ -82,7 +83,7 @@ void toc_item_private::load_children(GooList *items)
children[i] = new_item;
item->open();
GooList *item_children = item->getKids();
const GooList *item_children = item->getKids();
if (item_children) {
new_item->d->load_children(item_children);
}
......
......@@ -232,7 +232,7 @@ poppler_action_copy (PopplerAction *action)
static
PopplerDest *
dest_new_goto (PopplerDocument *document,
LinkDest *link_dest)
const LinkDest *link_dest)
{
PopplerDest *dest;
......@@ -337,9 +337,9 @@ dest_new_named (const GooString *named_dest)
static void
build_goto_dest (PopplerDocument *document,
PopplerAction *action,
LinkGoTo *link)
const LinkGoTo *link)
{
LinkDest *link_dest;
const LinkDest *link_dest;
const GooString *named_dest;
/* Return if it isn't OK */
......@@ -362,9 +362,9 @@ build_goto_dest (PopplerDocument *document,
static void
build_goto_remote (PopplerAction *action,
LinkGoToR *link)
const LinkGoToR *link)
{
LinkDest *link_dest;
const LinkDest *link_dest;
const GooString *named_dest;
/* Return if it isn't OK */
......@@ -389,7 +389,7 @@ build_goto_remote (PopplerAction *action,
static void
build_launch (PopplerAction *action,
LinkLaunch *link)
const LinkLaunch *link)
{
if (link->getFileName()) {
action->launch.file_name = g_strdup (link->getFileName()->getCString ());
......@@ -401,7 +401,7 @@ build_launch (PopplerAction *action,
static void
build_uri (PopplerAction *action,
LinkURI *link)
const LinkURI *link)
{
const gchar *uri;
......@@ -412,7 +412,7 @@ build_uri (PopplerAction *action,
static void
build_named (PopplerAction *action,
LinkNamed *link)
const LinkNamed *link)
{
const gchar *name;
......@@ -423,14 +423,14 @@ build_named (PopplerAction *action,
static AnnotMovie *
find_annot_movie_for_action (PopplerDocument *document,
LinkMovie *link)
const LinkMovie *link)
{
AnnotMovie *annot = nullptr;
XRef *xref = document->doc->getXRef ();
Object annotObj;
if (link->hasAnnotRef ()) {
Ref *ref = link->getAnnotRef ();
const Ref *ref = link->getAnnotRef ();
annotObj = xref->fetch (ref->num, ref->gen);
} else if (link->hasAnnotTitle ()) {
......@@ -490,7 +490,7 @@ find_annot_movie_for_action (PopplerDocument *document,
static void
build_movie (PopplerDocument *document,
PopplerAction *action,
LinkMovie *link)
const LinkMovie *link)
{
AnnotMovie *annot;
......@@ -519,7 +519,7 @@ build_movie (PopplerDocument *document,
static void
build_javascript (PopplerAction *action,
LinkJavaScript *link)
const LinkJavaScript *link)
{
const GooString *script;
......@@ -531,7 +531,7 @@ build_javascript (PopplerAction *action,
static void
build_rendition (PopplerAction *action,
LinkRendition *link)
const LinkRendition *link)
{
action->rendition.op = link->getOperation();
if (link->hasRenditionObject())
......@@ -575,9 +575,9 @@ get_layer_for_ref (PopplerDocument *document,
static void
build_ocg_state (PopplerDocument *document,
PopplerAction *action,
LinkOCGState *ocg_state)
const LinkOCGState *ocg_state)
{
GooList *st_list = ocg_state->getStateList();
const GooList *st_list = ocg_state->getStateList();
GBool preserve_rb = ocg_state->getPreserveRB();
gint i, j;
GList *layer_state = nullptr;
......@@ -618,7 +618,7 @@ build_ocg_state (PopplerDocument *document,
PopplerAction *
_poppler_action_new (PopplerDocument *document,
LinkAction *link,
const LinkAction *link,
const gchar *title)
{
PopplerAction *action;
......@@ -636,39 +636,39 @@ _poppler_action_new (PopplerDocument *document,
switch (link->getKind ()) {
case actionGoTo:
action->type = POPPLER_ACTION_GOTO_DEST;
build_goto_dest (document, action, dynamic_cast <LinkGoTo *> (link));
build_goto_dest (document, action, dynamic_cast <const LinkGoTo *> (link));
break;
case actionGoToR:
action->type = POPPLER_ACTION_GOTO_REMOTE;
build_goto_remote (action, dynamic_cast <LinkGoToR *> (link));
build_goto_remote (action, dynamic_cast <const LinkGoToR *> (link));
break;
case actionLaunch:
action->type = POPPLER_ACTION_LAUNCH;
build_launch (action, dynamic_cast <LinkLaunch *> (link));
build_launch (action, dynamic_cast <const LinkLaunch *> (link));
break;
case actionURI:
action->type = POPPLER_ACTION_URI;
build_uri (action, dynamic_cast <LinkURI *> (link));
build_uri (action, dynamic_cast <const LinkURI *> (link));
break;
case actionNamed:
action->type = POPPLER_ACTION_NAMED;
build_named (action, dynamic_cast <LinkNamed *> (link));
build_named (action, dynamic_cast <const LinkNamed *> (link));
break;
case actionMovie:
action->type = POPPLER_ACTION_MOVIE;
build_movie (document, action, dynamic_cast<LinkMovie*> (link));
build_movie (document, action, dynamic_cast<const LinkMovie*> (link));
break;
case actionRendition:
action->type = POPPLER_ACTION_RENDITION;
build_rendition (action, dynamic_cast<LinkRendition*> (link));
build_rendition (action, dynamic_cast<const LinkRendition*> (link));
break;
case actionOCGState:
action->type = POPPLER_ACTION_OCG_STATE;
build_ocg_state (document, action, dynamic_cast<LinkOCGState*> (link));
build_ocg_state (document, action, dynamic_cast<const LinkOCGState*> (link));
break;
case actionJavaScript:
action->type = POPPLER_ACTION_JAVASCRIPT;
build_javascript (action, dynamic_cast<LinkJavaScript*> (link));
build_javascript (action, dynamic_cast<const LinkJavaScript*> (link));
break;
case actionUnknown:
default:
......
......@@ -1735,7 +1735,7 @@ poppler_document_init (PopplerDocument *document)
struct _PopplerIndexIter
{
PopplerDocument *document;
GooList *items;
const GooList *items;
int index;
};
......@@ -1810,7 +1810,7 @@ poppler_index_iter_new (PopplerDocument *document)
{
PopplerIndexIter *iter;
Outline *outline;
GooList *items;
const GooList *items;
outline = document->doc->getOutline();
if (outline == nullptr)
......@@ -1860,7 +1860,7 @@ poppler_index_iter_get_child (PopplerIndexIter *parent)
}
static gchar *
unicode_to_char (Unicode *unicode,
unicode_to_char (const Unicode *unicode,
int len)
{
static UnicodeMap *uMap = nullptr;
......@@ -1916,7 +1916,7 @@ PopplerAction *
poppler_index_iter_get_action (PopplerIndexIter *iter)
{
OutlineItem *item;
LinkAction *link_action;
const LinkAction *link_action;
PopplerAction *action;
gchar *title;
......
......@@ -75,7 +75,7 @@ _poppler_layer_new (PopplerDocument *document,
GList *rbgroup)
{
PopplerLayer *poppler_layer;
GooString *layer_name;
const GooString *layer_name;
g_return_val_if_fail (POPPLER_IS_DOCUMENT (document), NULL);
g_return_val_if_fail (layer != nullptr, NULL);
......
......@@ -84,7 +84,7 @@ poppler_media_init (PopplerMedia *media)
}
PopplerMedia *
_poppler_media_new (MediaRendition *poppler_media)
_poppler_media_new (const MediaRendition *poppler_media)
{
PopplerMedia *media;
......@@ -93,7 +93,7 @@ _poppler_media_new (MediaRendition *poppler_media)
media = POPPLER_MEDIA (g_object_new (POPPLER_TYPE_MEDIA, nullptr));
if (poppler_media->getIsEmbedded()) {
GooString* mime_type;
const GooString* mime_type;
media->stream = poppler_media->getEmbbededStreamObject()->copy();
mime_type = poppler_media->getContentType();
......
......@@ -74,7 +74,7 @@ poppler_movie_init (PopplerMovie *movie)
}
PopplerMovie *
_poppler_movie_new (Movie *poppler_movie)
_poppler_movie_new (const Movie *poppler_movie)
{
PopplerMovie *movie;
......
......@@ -112,7 +112,7 @@ PopplerPage *_poppler_page_new (PopplerDocument *document,
Page *page,
int index);
PopplerAction *_poppler_action_new (PopplerDocument *document,
LinkAction *link,
const LinkAction *link,
const gchar *title);
PopplerLayer *_poppler_layer_new (PopplerDocument *document,
Layer *layer,
......@@ -122,8 +122,8 @@ PopplerDest *_poppler_dest_new_goto (PopplerDocument *document,
PopplerFormField *_poppler_form_field_new (PopplerDocument *document,
FormWidget *field);
PopplerAttachment *_poppler_attachment_new (FileSpec *file);
PopplerMovie *_poppler_movie_new (Movie *movie);
PopplerMedia *_poppler_media_new (MediaRendition *media);
PopplerMovie *_poppler_movie_new (const Movie *movie);
PopplerMedia *_poppler_media_new (const MediaRendition *media);
PopplerAnnot *_poppler_annot_new (Annot *annot);
PopplerAnnot *_poppler_annot_text_new (Annot *annot);
PopplerAnnot *_poppler_annot_free_text_new (Annot *annot);
......
......@@ -6,6 +6,20 @@
//
//========================================================================
//========================================================================
//
// Modified under the Poppler project - http://poppler.freedesktop.org
//
// All changes made under the Poppler project to this file are licensed
// under GPL version 2 or later
//
// Copyright (C) 2018 Albert Astals Cid <aacid@kde.org>
//
// To see a description of the changes please see the Changelog file that
// came with your tarball or type make ChangeLog if you are building from git
//
//========================================================================
#include <config.h>
#ifdef USE_GCC_PRAGMAS
......@@ -39,7 +53,7 @@ GooList::~GooList() {
gfree(data);
}
GooList *GooList::copy() {
GooList *GooList::copy() const {
GooList *ret;
ret = new GooList(length);
......
......@@ -13,7 +13,7 @@
// All changes made under the Poppler project to this file are licensed
// under GPL version 2 or later
//
// Copyright (C) 2012 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2012, 2018 Albert Astals Cid <aacid@kde.org>
//
// To see a description of the changes please see the Changelog file that
// came with your tarball or type make ChangeLog if you are building from git
......@@ -48,16 +48,16 @@ public:
//----- general
// Get the number of elements.
int getLength() { return length; }
int getLength() const { return length; }
// Returns a (shallow) copy of this list.
GooList *copy();
GooList *copy() const;
//----- ordered list support
// Return the <i>th element.
// Assumes 0 <= i < length.
void *get(int i) { return data[i]; }
void *get(int i) const { return data[i]; }
// Replace the <i>th element.
// Assumes 0 <= i < length.
......
......@@ -7,7 +7,7 @@
//
// Copyright (C) 2008-2009 Carlos Garcia Campos <carlosgc@gnome.org>
// Copyright (C) 2009 Kovid Goyal <kovid@kovidgoyal.net>
// Copyright (C) 2012, 2017 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2012, 2017, 2018 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2012 Hib Eris <hib@hiberis.nl>
// Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich
//
......@@ -28,7 +28,7 @@
#include "FileSpec.h"
EmbFile::EmbFile(Object *efStream)
EmbFile::EmbFile(const Object *efStream)
{
m_size = -1;
m_createDate = nullptr;
......@@ -100,7 +100,7 @@ GBool EmbFile::save2(FILE *f) {
return gTrue;
}
FileSpec::FileSpec(Object *fileSpecA)
FileSpec::FileSpec(const Object *fileSpecA)
{
ok = gTrue;
fileName = nullptr;
......@@ -172,7 +172,7 @@ GooString *FileSpec::getFileNameForPlatform()
return platformFileName;
}
Object getFileSpecName (Object *fileSpec)
Object getFileSpecName (const Object *fileSpec)
{
if (fileSpec->isString()) {
return fileSpec->copy();
......@@ -203,7 +203,7 @@ Object getFileSpecName (Object *fileSpec)
return Object();
}
Object getFileSpecNameForPlatform (Object *fileSpec)
Object getFileSpecNameForPlatform (const Object *fileSpec)
{
if (fileSpec->isString()) {
return fileSpec->copy();
......
......@@ -24,20 +24,20 @@
class EmbFile {
public:
EmbFile(Object *efStream);
EmbFile(const Object *efStream);
~EmbFile();
EmbFile(const EmbFile &) = delete;
EmbFile& operator=(const EmbFile &) = delete;
int size() { return m_size; }
GooString *modDate() { return m_modDate; }
GooString *createDate() { return m_createDate; }
GooString *checksum() { return m_checksum; }
GooString *mimeType() { return m_mimetype; }
int size() const { return m_size; }
const GooString *modDate() const { return m_modDate; }
const GooString *createDate() const { return m_createDate; }
const GooString *checksum() const { return m_checksum; }
const GooString *mimeType() const { return m_mimetype; }
Object *streamObject() { return &m_objStr; }
Stream *stream() { return isOk() ? m_objStr.getStream() : NULL; }
GBool isOk() { return m_objStr.isStream(); }
GBool isOk() const { return m_objStr.isStream(); }
GBool save(const char *path);
private:
......@@ -53,17 +53,17 @@ private:
class FileSpec {
public:
FileSpec(Object *fileSpec);
FileSpec(const Object *fileSpec);
~FileSpec();
FileSpec(const FileSpec &) = delete;
FileSpec& operator=(const FileSpec &) = delete;
GBool isOk() { return ok; }
GBool isOk() const { return ok; }
GooString *getFileName() const { return fileName; }
const GooString *getFileName() const { return fileName; }
GooString *getFileNameForPlatform();
GooString *getDescription() const { return desc; }
const GooString *getDescription() const { return desc; }
EmbFile *getEmbeddedFile();
private:
......@@ -78,7 +78,7 @@ private:
GooString *desc; // Desc
};
Object getFileSpecName (Object *fileSpec);
Object getFileSpecNameForPlatform (Object *fileSpec);
Object getFileSpecName (const Object *fileSpec);
Object getFileSpecNameForPlatform (const Object *fileSpec);
#endif /* FILE_SPEC_H */
......@@ -240,7 +240,7 @@ public:
void transform(double *in, double *out) override;
GBool isOk() override { return ok; }
GooString *getCodeString() { return codeString; }
const GooString *getCodeString() const { return codeString; }
private:
......
......@@ -16,7 +16,7 @@
// Copyright (C) 2006, 2008 Pino Toscano <pino@kde.org>
// Copyright (C) 2007, 2010, 2011 Carlos Garcia Campos <carlosgc@gnome.org>
// Copyright (C) 2008 Hugo Mercier <hmercier31@gmail.com>
// Copyright (C) 2008-2010, 2012-2014, 2016, 2017 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2008-2010, 2012-2014, 2016-2018 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2009 Kovid Goyal <kovid@kovidgoyal.net>
// Copyright (C) 2009 Ilya Gorenbein <igorenbein@finjan.com>
// Copyright (C) 2012 Tobias Koening <tobias.koenig@kdab.com>
......@@ -52,7 +52,7 @@
// LinkAction
//------------------------------------------------------------------------
LinkAction *LinkAction::parseDest(Object *obj) {
LinkAction *LinkAction::parseDest(const Object *obj) {
LinkAction *action;
action = new LinkGoTo(obj);
......@@ -63,7 +63,7 @@ LinkAction *LinkAction::parseDest(Object *obj) {
return action;
}
LinkAction *LinkAction::parseAction(Object *obj, GooString *baseURI) {
LinkAction *LinkAction::parseAction(const Object *obj, const GooString *baseURI) {
LinkAction *action;
if (!obj->isDict()) {
......@@ -142,7 +142,7 @@ LinkAction *LinkAction::parseAction(Object *obj, GooString *baseURI) {
// LinkDest
//------------------------------------------------------------------------
LinkDest::LinkDest(Array *a) {
LinkDest::LinkDest(const Array *a) {
// initialize fields
left = bottom = right = top = zoom = 0;
changeLeft = changeTop = changeZoom = gFalse;
......@@ -340,7 +340,7 @@ LinkDest::LinkDest(Array *a) {
return;
}
LinkDest::LinkDest(LinkDest *dest) {
LinkDest::LinkDest(const LinkDest *dest) {
kind = dest->kind;
pageIsRef = dest->pageIsRef;
if (pageIsRef)
......@@ -362,7 +362,7 @@ LinkDest::LinkDest(LinkDest *dest) {
// LinkGoTo
//------------------------------------------------------------------------
LinkGoTo::LinkGoTo(Object *destObj) {
LinkGoTo::LinkGoTo(const Object *destObj) {
dest = nullptr;
namedDest = nullptr;
......@@ -442,7 +442,7 @@ LinkGoToR::~LinkGoToR() {
// LinkLaunch
//------------------------------------------------------------------------
LinkLaunch::LinkLaunch(Object *actionObj) {
LinkLaunch::LinkLaunch(const Object *actionObj) {
fileName = nullptr;
params = nullptr;
......@@ -490,7 +490,7 @@ LinkLaunch::~LinkLaunch() {
// LinkURI
//------------------------------------------------------------------------
LinkURI::LinkURI(Object *uriObj, GooString *baseURI) {
LinkURI::LinkURI(const Object *uriObj, const GooString *baseURI) {
const GooString *uri2;
int n;
char c;
......@@ -539,7 +539,7 @@ LinkURI::~LinkURI() {
// LinkNamed
//------------------------------------------------------------------------
LinkNamed::LinkNamed(Object *nameObj) {
LinkNamed::LinkNamed(const Object *nameObj) {
name = nullptr;
if (nameObj->isName()) {
name = new GooString(nameObj->getName());
......@@ -556,7 +556,7 @@ LinkNamed::~LinkNamed() {
// LinkMovie
//------------------------------------------------------------------------
LinkMovie::LinkMovie(Object *obj) {
LinkMovie::LinkMovie(const Object *obj) {
annotRef.num = -1;
annotTitle = nullptr;
......@@ -604,7 +604,7 @@ LinkMovie::~LinkMovie() {
// LinkSound
//------------------------------------------------------------------------
LinkSound::LinkSound(Object *soundObj) {
LinkSound::LinkSound(const Object *soundObj) {
volume = 1.0;
sync = gFalse;
repeat = gFalse;
......@@ -646,7 +646,7 @@ LinkSound::~LinkSound() {
// LinkRendition
//------------------------------------------------------------------------
LinkRendition::LinkRendition(Object *obj) {
LinkRendition::LinkRendition(const Object *obj) {
operation = NoRendition;
media = nullptr;
js = nullptr;
......@@ -743,7 +743,7 @@ LinkJavaScript::~LinkJavaScript() {
//------------------------------------------------------------------------
// LinkOCGState
//------------------------------------------------------------------------
LinkOCGState::LinkOCGState(Object *obj) {
LinkOCGState::LinkOCGState(const Object *obj) {
stateList = new GooList();
preserveRB = gTrue;
......
This diff is collapsed.
......@@ -6,7 +6,7 @@
// Hugo Mercier <hmercier31[at]gmail.com> (c) 2008
// Pino Toscano <pino@kde.org> (c) 2008
// Carlos Garcia Campos <carlosgc@gnome.org> (c) 2010
// Albert Astals Cid <aacid@kde.org> (c) 2010, 2017
// Albert Astals Cid <aacid@kde.org> (c) 2010, 2017, 2018
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
......@@ -46,7 +46,7 @@ MovieActivationParameters::MovieActivationParameters() {
MovieActivationParameters::~MovieActivationParameters() {
}
void MovieActivationParameters::parseMovieActivation(Object* aDict) {
void MovieActivationParameters::parseMovieActivation(const Object* aDict) {
Object obj1 = aDict->dictLookup("Start");
if (obj1.isNull()) {
if (obj1.isInt()) {
......@@ -172,7 +172,7 @@ void MovieActivationParameters::parseMovieActivation(Object* aDict) {
}
}
void Movie::parseMovie (Object *movieDict) {
void Movie::parseMovie (const Object *movieDict) {
fileName = nullptr;
rotationAngle = 0;
width = -1;
......@@ -230,7 +230,7 @@ Movie::~Movie() {
delete fileName;
}
Movie::Movie(Object *movieDict) {
Movie::Movie(const Object *movieDict) {
ok = gTrue;
if (movieDict->isDict())
......@@ -239,7 +239,7 @@ Movie::Movie(Object *movieDict) {
ok = gFalse;
}
Movie::Movie(Object *movieDict, Object *aDict) {
Movie::Movie(const Object *movieDict, const Object *aDict) {
ok = gTrue;
if (movieDict->isDict()) {
......@@ -274,6 +274,6 @@ void Movie::getFloatingWindowSize(int *widthA, int *heightA)