diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 71de080fa6..bc65a0cc74 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -192,7 +192,7 @@ public: map errorLists; /// all embedded files of this buffer - EmbeddedFiles embedded_files; + EmbeddedFileList embedded_files; /// timestamp and checksum used to test if the file has been externally /// modified. (Used to properly enable 'File->Revert to saved', bug 4114). @@ -366,13 +366,13 @@ TocBackend & Buffer::tocBackend() const } -EmbeddedFiles & Buffer::embeddedFiles() +EmbeddedFileList & Buffer::embeddedFiles() { return d->embedded_files; } -EmbeddedFiles const & Buffer::embeddedFiles() const +EmbeddedFileList const & Buffer::embeddedFiles() const { return d->embedded_files; } diff --git a/src/Buffer.h b/src/Buffer.h index 627ac0761b..61f6c4ae09 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -25,7 +25,7 @@ namespace lyx { class BufferParams; -class EmbeddedFiles; +class EmbeddedFileList; class DocIterator; class ErrorItem; class ErrorList; @@ -57,7 +57,6 @@ class WorkAreaManager; namespace support { class FileName; -class EmbeddedFileList; } /** The buffer object. @@ -304,7 +303,7 @@ public: void updateBibfilesCache() const; /// Return the cache with all bibfiles in use (including bibfiles /// of loaded child documents). - support::EmbeddedFileList const & getBibfilesCache() const; + EmbeddedFileList const & getBibfilesCache() const; /// void getLabelList(std::vector &) const; @@ -405,8 +404,8 @@ public: TocBackend & tocBackend() const; //@{ - EmbeddedFiles & embeddedFiles(); - EmbeddedFiles const & embeddedFiles() const; + EmbeddedFileList & embeddedFiles(); + EmbeddedFileList const & embeddedFiles() const; bool embedded() const; //@} diff --git a/src/EmbeddedFiles.cpp b/src/EmbeddedFiles.cpp index 5126f45a71..e416ef9079 100644 --- a/src/EmbeddedFiles.cpp +++ b/src/EmbeddedFiles.cpp @@ -1,6 +1,6 @@ // -*- C++ -*- /** - * \file EmbeddedFiles.cpp + * \file EmbeddedFileList.cpp * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * @@ -306,7 +306,7 @@ bool operator!=(EmbeddedFile const & lhs, EmbeddedFile const & rhs) } -void EmbeddedFiles::enable(bool flag, Buffer & buffer) +void EmbeddedFileList::enable(bool flag, Buffer & buffer) { if (buffer.embedded() == flag) return; @@ -347,7 +347,7 @@ void EmbeddedFiles::enable(bool flag, Buffer & buffer) } -void EmbeddedFiles::registerFile(EmbeddedFile const & file, +void EmbeddedFileList::registerFile(EmbeddedFile const & file, Inset const * inset, Buffer const & buffer) { BOOST_ASSERT(!buffer.embedded() || file.availableFile().exists()); @@ -376,7 +376,7 @@ void EmbeddedFiles::registerFile(EmbeddedFile const & file, } -void EmbeddedFiles::update(Buffer const & buffer) +void EmbeddedFileList::update(Buffer const & buffer) { clear(); @@ -385,7 +385,7 @@ void EmbeddedFiles::update(Buffer const & buffer) } -bool EmbeddedFiles::writeFile(DocFileName const & filename, Buffer const & buffer) +bool EmbeddedFileList::writeFile(DocFileName const & filename, Buffer const & buffer) { // file in the temporary path has the content string const content = FileName(addName(buffer.temppath(), diff --git a/src/EmbeddedFiles.h b/src/EmbeddedFiles.h index 07c522a931..403f9cfa2a 100644 --- a/src/EmbeddedFiles.h +++ b/src/EmbeddedFiles.h @@ -167,7 +167,7 @@ bool operator==(EmbeddedFile const & lhs, EmbeddedFile const & rhs); bool operator!=(EmbeddedFile const & lhs, EmbeddedFile const & rhs); -class EmbeddedFiles : public std::vector { +class EmbeddedFileList : public std::vector { public: /// set buffer params embedded flag. Files will be updated or extracted /// if such an operation fails, enable will fail. diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index be58327303..ad08b559da 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -970,10 +970,10 @@ void GuiDocument::updateEmbeddedFileList() { embeddedFilesModule->filesLW->clear(); // add current embedded files - EmbeddedFiles & files = buffer().embeddedFiles(); + EmbeddedFileList & files = buffer().embeddedFiles(); files.update(buffer()); - EmbeddedFiles::iterator fit = files.begin(); - EmbeddedFiles::iterator fit_end = files.end(); + EmbeddedFileList::iterator fit = files.begin(); + EmbeddedFileList::iterator fit_end = files.end(); for (; fit != fit_end; ++fit) { QString label = toqstr(fit->relFilename(buffer().filePath())); if (fit->refCount() > 1) diff --git a/src/insets/Inset.h b/src/insets/Inset.h index c512abc27b..ff97143abb 100644 --- a/src/insets/Inset.h +++ b/src/insets/Inset.h @@ -51,7 +51,7 @@ class ParIterator; class Text; class TocList; class EmbeddedFile; -class EmbeddedFiles; +class EmbeddedFileList; namespace graphics { class PreviewLoader; } @@ -357,7 +357,7 @@ public: /// pit is the ParConstIterator of the paragraph containing the inset virtual void addToToc(TocList &, Buffer const &, ParConstIterator const &) const {} /// report files that can be embedded with the lyx file - virtual void registerEmbeddedFiles(Buffer const &, EmbeddedFiles &) const {} + virtual void registerEmbeddedFiles(Buffer const &, EmbeddedFileList &) const {} /// use embedded or external file after the embedding status of a file is changed virtual void updateEmbeddedFile(Buffer const &, EmbeddedFile const &) {} /// Fill keys with BibTeX information diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp index 943e65afe8..4a92b784d8 100644 --- a/src/insets/InsetBibtex.cpp +++ b/src/insets/InsetBibtex.cpp @@ -17,6 +17,7 @@ #include "BufferParams.h" #include "DispatchResult.h" #include "support/debug.h" +#include "EmbeddedFiles.h" #include "Encoding.h" #include "FuncRequest.h" #include "support/gettext.h" @@ -29,7 +30,6 @@ #include "support/ExceptionMessage.h" #include "support/docstream.h" -#include "support/FileNameList.h" #include "support/filetools.h" #include "support/lstrings.h" #include "support/os.h" @@ -805,7 +805,7 @@ void InsetBibtex::validate(LaTeXFeatures & features) const } -void InsetBibtex::registerEmbeddedFiles(Buffer const & buffer, EmbeddedFiles & files) const +void InsetBibtex::registerEmbeddedFiles(Buffer const & buffer, EmbeddedFileList & files) const { EmbeddedFileList const dbs = getFiles(buffer); for (vector::const_iterator it = dbs.begin(); @@ -822,7 +822,7 @@ void InsetBibtex::updateEmbeddedFile(Buffer const & buf, EmbeddedFile const & fi bool first = true; EmbeddedFileList dbs = getFiles(buf); - for (vector::iterator it = dbs.begin(); + for (EmbeddedFileList::iterator it = dbs.begin(); it != dbs.end(); ++ it) { // update from file if (it->absFilename() == file.absFilename()) diff --git a/src/insets/InsetBibtex.h b/src/insets/InsetBibtex.h index c9c7fe5a49..e6c8748c95 100644 --- a/src/insets/InsetBibtex.h +++ b/src/insets/InsetBibtex.h @@ -18,9 +18,7 @@ namespace lyx { -namespace support { class EmbeddedFileList; -} /** Used to insert BibTeX's information @@ -43,7 +41,7 @@ public: virtual void fillWithBibKeys(Buffer const &, BiblioInfo &, InsetIterator const &) const; /// - support::EmbeddedFileList const getFiles(Buffer const &) const; + EmbeddedFileList const getFiles(Buffer const &) const; /// bool addDatabase(std::string const &); /// @@ -58,7 +56,7 @@ public: static bool isCompatibleCommand(std::string const & s) { return s == "bibtex"; } /// - void registerEmbeddedFiles(Buffer const &, EmbeddedFiles &) const; + void registerEmbeddedFiles(Buffer const &, EmbeddedFileList &) const; /// void updateEmbeddedFile(Buffer const & buf, EmbeddedFile const & file); diff --git a/src/insets/InsetCitation.cpp b/src/insets/InsetCitation.cpp index de8af5727b..d899d929e0 100644 --- a/src/insets/InsetCitation.cpp +++ b/src/insets/InsetCitation.cpp @@ -18,12 +18,12 @@ #include "support/debug.h" #include "DispatchResult.h" #include "support/gettext.h" +#include "EmbeddedFiles.h" #include "FuncRequest.h" #include "LaTeXFeatures.h" #include "support/lstrings.h" #include "support/docstream.h" -#include "support/FileNameList.h" #include @@ -144,10 +144,10 @@ docstring const getComplexLabel(Buffer const & buffer, BiblioInfo biblist; - support::EmbeddedFileList const & bibfilesCache = buffer.getBibfilesCache(); + EmbeddedFileList const & bibfilesCache = buffer.getBibfilesCache(); // compare the cached timestamps with the actual ones. bool changed = false; - for (support::EmbeddedFileList::const_iterator it = bibfilesCache.begin(); + for (EmbeddedFileList::const_iterator it = bibfilesCache.begin(); it != bibfilesCache.end(); ++ it) { FileName const f = *it; time_t lastw = f.lastModified(); diff --git a/src/insets/InsetExternal.cpp b/src/insets/InsetExternal.cpp index fe570b642e..2b5a87e83c 100644 --- a/src/insets/InsetExternal.cpp +++ b/src/insets/InsetExternal.cpp @@ -497,7 +497,7 @@ bool InsetExternal::getStatus(Cursor & cur, FuncRequest const & cmd, void InsetExternal::registerEmbeddedFiles(Buffer const & buffer, - EmbeddedFiles & files) const + EmbeddedFileList & files) const { files.registerFile(params_.filename, this, buffer); } diff --git a/src/insets/InsetExternal.h b/src/insets/InsetExternal.h index 533eeb92b9..2b586153b6 100644 --- a/src/insets/InsetExternal.h +++ b/src/insets/InsetExternal.h @@ -149,7 +149,7 @@ public: /// bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const; /// external file can be embedded - void registerEmbeddedFiles(Buffer const &, EmbeddedFiles &) const; + void registerEmbeddedFiles(Buffer const &, EmbeddedFileList &) const; /// void updateEmbeddedFile(Buffer const &, EmbeddedFile const &); diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp index 6a68eb98fc..65c4d2d43b 100644 --- a/src/insets/InsetGraphics.cpp +++ b/src/insets/InsetGraphics.cpp @@ -217,7 +217,7 @@ bool InsetGraphics::getStatus(Cursor & cur, FuncRequest const & cmd, void InsetGraphics::registerEmbeddedFiles(Buffer const & buffer, - EmbeddedFiles & files) const + EmbeddedFileList & files) const { files.registerFile(params().filename, this, buffer); } diff --git a/src/insets/InsetGraphics.h b/src/insets/InsetGraphics.h index 4dfe1a9a94..e74eea5e93 100644 --- a/src/insets/InsetGraphics.h +++ b/src/insets/InsetGraphics.h @@ -79,7 +79,7 @@ public: /// bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const; /// all graphics can be embedded - void registerEmbeddedFiles(Buffer const &, EmbeddedFiles &) const; + void registerEmbeddedFiles(Buffer const &, EmbeddedFileList &) const; /// void updateEmbeddedFile(Buffer const &, EmbeddedFile const &); /// Force inset into LTR environment if surroundings are RTL? diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index 8ed648c811..fdc9abacef 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -899,7 +899,7 @@ void InsetInclude::updateLabels(Buffer const & buffer, ParIterator const &) void InsetInclude::registerEmbeddedFiles(Buffer const & buffer, - EmbeddedFiles & files) const + EmbeddedFileList & files) const { files.registerFile(includedFilename(buffer, params()), this, buffer); } diff --git a/src/insets/InsetInclude.h b/src/insets/InsetInclude.h index 6dc5142618..635ba9c69a 100644 --- a/src/insets/InsetInclude.h +++ b/src/insets/InsetInclude.h @@ -30,10 +30,6 @@ class Dimension; class LaTeXFeatures; class RenderMonitoredPreview; -namespace support { -class EmbeddedFileList; -} - /// for including tex/lyx files class InsetInclude : public InsetCommand { public: @@ -74,7 +70,7 @@ public: * Return an empty vector if the child doc is not loaded. * \param buffer the Buffer containing this inset. */ - support::EmbeddedFileList const & + EmbeddedFileList const & getBibfilesCache(Buffer const & buffer) const; /// EDITABLE editable() const { return IS_EDITABLE; } @@ -96,7 +92,7 @@ public: /// void updateLabels(Buffer const & buffer, ParIterator const &); /// child document can be embedded - void registerEmbeddedFiles(Buffer const &, EmbeddedFiles &) const; + void registerEmbeddedFiles(Buffer const &, EmbeddedFileList &) const; /// void updateEmbeddedFile(Buffer const & buf, EmbeddedFile const & file); /// diff --git a/src/support/FileNameList.h b/src/support/FileNameList.h index 6cf61abc5c..20b6a85af7 100644 --- a/src/support/FileNameList.h +++ b/src/support/FileNameList.h @@ -13,7 +13,6 @@ #define FILENAMELIST_H #include "support/FileName.h" -#include "EmbeddedFiles.h" #include @@ -29,10 +28,6 @@ class FileNameList: public std::vector { }; -class EmbeddedFileList: public std::vector -{ -}; - } // namespace support } // namespace lyx