#include "Changes.h"
#include "Cursor.h"
#include "CutAndPaste.h"
-#include "debug.h"
#include "DispatchResult.h"
#include "ErrorList.h"
#include "FuncRequest.h"
-#include "gettext.h"
#include "Language.h"
#include "Layout.h"
#include "Lexer.h"
#include "Paragraph.h"
#include "paragraph_funcs.h"
#include "ParagraphParameters.h"
-#include "ParIterator.h"
-#include "Server.h"
-#include "ServerSocket.h"
#include "TextClass.h"
#include "TextMetrics.h"
#include "VSpace.h"
#include "mathed/InsetMathHull.h"
+#include "support/debug.h"
+#include "support/gettext.h"
#include "support/textutils.h"
-#include <boost/current_function.hpp>
#include <boost/next_prior.hpp>
#include <sstream>
-using std::endl;
-using std::ostringstream;
-using std::string;
-using std::max;
-using std::min;
-using std::istringstream;
+using namespace std;
namespace lyx {
void Text::setInsetFont(BufferView const & bv, pit_type pit,
pos_type pos, Font const & font, bool toggleall)
{
- BOOST_ASSERT(pars_[pit].isInset(pos) &&
- pars_[pit].getInset(pos)->noFontChange());
-
Inset * const inset = pars_[pit].getInset(pos);
+ BOOST_ASSERT(inset && inset->noFontChange());
+
CursorSlice::idx_type endidx = inset->nargs();
for (CursorSlice cs(*inset); cs.idx() != endidx; ++cs.idx()) {
Text * text = cs.text();
if (dit.pos() != dit.lastpos()) {
pit_type const pit = dit.pit();
pos_type const pos = dit.pos();
- if (pars_[pit].isInset(pos) &&
- pars_[pit].getInset(pos)->noFontChange())
+ Inset * inset = pars_[pit].getInset(pos);
+ if (inset && inset->noFontChange()) {
// We need to propagate the font change to all
// text cells of the inset (bug 1973).
// FIXME: This should change, see documentation
// of noFontChange in Inset.h
setInsetFont(bv, pit, pos, font, toggleall);
+ }
TextMetrics const & tm = bv.textMetrics(this);
Font f = tm.getDisplayFont(pit, pos);
f.update(font, language, toggleall);
bool const soa = oldpar.params().startOfAppendix();
plist.erase(boost::next(plist.begin(), old.pit()));
// do not lose start of appendix marker (bug 4212)
- if (soa && old.pit() < plist.size())
+ if (soa && old.pit() < pit_type(plist.size()))
plist[old.pit()].params().startOfAppendix(true);
// see #warning (FIXME?) above